From 9aa5f7c883a7d2e01bfec2039322b8060ebff044 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Wed, 30 Oct 2024 18:48:26 +0100 Subject: Force resolution of unpacked jars [no changelog] --- build.gradle.kts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'build.gradle.kts') diff --git a/build.gradle.kts b/build.gradle.kts index effa917..15a5e78 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,6 @@ */ import com.google.devtools.ksp.gradle.KspTaskJvm -import com.google.gson.JsonArray import moe.nea.licenseextractificator.LicenseDiscoveryTask import moe.nea.mcautotranslations.gradle.CollectTranslations import net.fabricmc.loom.LoomGradleExtension @@ -101,7 +100,7 @@ kotlin { } } fun String.capitalizeN() = replaceFirstChar { it.uppercaseChar() } -fun innerJarsOf(name: String, dependency: Dependency): FileCollection { +fun innerJarsOf(name: String, dependency: Dependency): Provider { val task = tasks.create("unpackInnerJarsFor${name.capitalizeN()}", InnerJarsUnpacker::class) { this.inputJars.setFrom(files(configurations.detachedConfiguration(dependency))) this.outputDir.set(layout.buildDirectory.dir("unpackedJars/$name").also { @@ -109,7 +108,11 @@ fun innerJarsOf(name: String, dependency: Dependency): FileCollection { }) } println("Constructed innerJars task: ${project.files(task).toList()}") - return project.files(task) + return project.provider { + val files = project.files(task) + files.files // Force resolution + files.asFileTree + } } val collectTranslations by tasks.registering(CollectTranslations::class) { @@ -242,7 +245,8 @@ dependencies { (sodiumSourceSet.modImplementationConfigurationName)(libs.sodium) (citResewnSourceSet.modImplementationConfigurationName)( - innerJarsOf("citresewn", dependencies.create(libs.citresewn.get())).asFileTree) + innerJarsOf("citresewn", dependencies.create(libs.citresewn.get())) + ) (citResewnSourceSet.modImplementationConfigurationName)(libs.citresewn) (yaclSourceSet.modImplementationConfigurationName)(libs.yacl) -- cgit