Force even earlier init of unpacked Jars
[no changelog]
This commit is contained in:
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
@@ -25,7 +25,10 @@ jobs:
|
|||||||
- name: Set up gradle cache
|
- name: Set up gradle cache
|
||||||
uses: gradle/actions/setup-gradle@v3
|
uses: gradle/actions/setup-gradle@v3
|
||||||
- name: Build with gradle
|
- name: Build with gradle
|
||||||
run: ./gradlew clean test remapJar --stacktrace
|
run: |
|
||||||
|
./gradlew clean
|
||||||
|
./gradlew unpackAllJars --stacktrace
|
||||||
|
./gradlew test remapJar --stacktrace
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -100,18 +100,22 @@ kotlin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
fun String.capitalizeN() = replaceFirstChar { it.uppercaseChar() }
|
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> {
|
fun innerJarsOf(name: String, dependency: Dependency): Provider<FileTree> {
|
||||||
val task = tasks.create("unpackInnerJarsFor${name.capitalizeN()}", InnerJarsUnpacker::class) {
|
val task = tasks.create("unpackInnerJarsFor${name.capitalizeN()}", InnerJarsUnpacker::class) {
|
||||||
|
doFirst {
|
||||||
|
println("Unpacking JARs for $name")
|
||||||
|
}
|
||||||
this.inputJars.setFrom(files(configurations.detachedConfiguration(dependency)))
|
this.inputJars.setFrom(files(configurations.detachedConfiguration(dependency)))
|
||||||
this.outputDir.set(layout.buildDirectory.dir("unpackedJars/$name").also {
|
this.outputDir.set(layout.buildDirectory.dir("unpackedJars/$name").also {
|
||||||
it.get().asFile.mkdirs()
|
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 {
|
return project.provider {
|
||||||
val files = project.files(task)
|
project.files(task).asFileTree
|
||||||
files.files // Force resolution
|
|
||||||
files.asFileTree
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user