aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-10-31 22:49:44 +0100
committerLinnea Gräf <nea@nea.moe>2024-10-31 23:20:24 +0100
commit653454e290a1bb6142e2bb40947239c2e450820b (patch)
tree063175796d2038e9626836705100c554bf47babc
parent7a5335756960d77ca4d12cf49b59ea273b5a8f64 (diff)
downloadFirmament-653454e290a1bb6142e2bb40947239c2e450820b.tar.gz
Firmament-653454e290a1bb6142e2bb40947239c2e450820b.tar.bz2
Firmament-653454e290a1bb6142e2bb40947239c2e450820b.zip
Force even earlier init of unpacked Jars
[no changelog]
-rw-r--r--.github/workflows/build.yml5
-rw-r--r--build.gradle.kts12
2 files changed, 12 insertions, 5 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index b048e5b..123893a 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -25,7 +25,10 @@ jobs:
- name: Set up gradle cache
uses: gradle/actions/setup-gradle@v3
- name: Build with gradle
- run: ./gradlew clean test remapJar --stacktrace
+ run: |
+ ./gradlew clean
+ ./gradlew unpackAllJars --stacktrace
+ ./gradlew test remapJar --stacktrace
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
diff --git a/build.gradle.kts b/build.gradle.kts
index 15a5e78..64d80fe 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -100,18 +100,22 @@ kotlin {
}
}
fun String.capitalizeN() = replaceFirstChar { it.uppercaseChar() }
+// Usually a normal sync takes care of this, but in CI everything needs to run in one shot, so we need to improvise.
+val unpackAllJars by tasks.registering
fun innerJarsOf(name: String, dependency: Dependency): Provider<FileTree> {
val task = tasks.create("unpackInnerJarsFor${name.capitalizeN()}", InnerJarsUnpacker::class) {
+ doFirst {
+ println("Unpacking JARs for $name")
+ }
this.inputJars.setFrom(files(configurations.detachedConfiguration(dependency)))
this.outputDir.set(layout.buildDirectory.dir("unpackedJars/$name").also {
it.get().asFile.mkdirs()
})
}
- println("Constructed innerJars task: ${project.files(task).toList()}")
+ unpackAllJars { dependsOn(task) }
+ println("Constructed innerJars task: ${project.files(task).asFileTree.toList().map {it to it.exists()}}")
return project.provider {
- val files = project.files(task)
- files.files // Force resolution
- files.asFileTree
+ project.files(task).asFileTree
}
}