Nezteb
04/25/2019, 4:25 PMtasks {
jar {
archiveName = "onboarding.jar"
println("Hello world")
}
}
}
This compiles just fine, but doesn’t print for me, so I assume not.Czar
04/25/2019, 4:31 PMprintln
will be executed during jar task configuration. Unless jar is actually configured by gradle, println
won't be executed.Czar
04/25/2019, 4:32 PMCzar
04/25/2019, 4:33 PMNezteb
04/25/2019, 4:52 PMtasks.register("hello") {
group = "build"
doFirst {
val runtimes = configurations.runtimeClasspath.get().joinToString(" ") { it.name }
println("Runtimes: $runtimes")
val compiles = configurations.compile.get().joinToString(" ") { it.name }
println("Compiles: $compiles")
}
}
Nezteb
04/25/2019, 4:52 PMCzar
04/25/2019, 5:09 PMCzar
04/25/2019, 5:09 PM./gradlew hello
then it will print