Why this is not working?
I config it first then unzip it at the execution phase where I could run it manually.
val nativesOS : Configuration by configurations.creating {
this.isTransitive = false
this.extendsFrom(configurations.runtimeOnly.get())
}
dependencies {
implementation(platform("org.lwjgl:lwjgl-bom:3.2.3"))
nativeOS("org.lwjgl","lwjgl", "3.2.3", classifier = "natives-windows")
...
}
// config-phase
tasks.register<Copy>("unzip_native_os") {
this.group = "zip"
// config-phase
val nativesJar = nativesOS.asFileTree.filter { it.name.contains("natives") }.files
// execution phase
doFirst {
nativesJar.forEach {
println(">>>> $it")
unzipTo(File("$buildDir/libs/natives-os"), it)
}
}
}