Darryl Miles
01/22/2024, 6:18 PMtask explodedWar(type: Sync) {
into "${buildDir}/libs/exploded/yourWar.war"
with war
}
// my efforts get to
tasks.register<Sync>("explodedWar") {
into("${layout.buildDirectory}/libs/exploded/yourWar.war")
with(war)
// ^^^ --- red error markers
}
// can't find anything with the correct type on content assist
It wants a CopySpec
which I assume needs to be all the standard outputs in the WAR tree format
There is an implicit configuration called archives
that produces the non-exploded WAR file. So this must clear have configuration with all the data in some format necessary (input file -> output file, mappings)
Without the with()
part, nothing appears to happen, I also don't get the default configuration action for archives
anymore, when really I would like it to always emit the standard output artifacts, but in addition produce an exploded.Szymon Jeziorski
01/22/2024, 7:17 PMVampire
01/22/2024, 7:20 PMwar
you marked is in Groovy DSL simply a reference to the task called war
that in itself is also a CopySpec
. So what you are after should be with(tasks.war.get())
Darryl Miles
01/22/2024, 10:23 PMtasks.register<Copy>("explodedWar") {
into(layout.buildDirectory.dir("libs/exploded"))
with(tasks.war.get())
}
Thanks for the replies.Vampire
01/22/2024, 10:34 PMCopy
+`Sync`Vampire
01/22/2024, 10:35 PMCopy
task you practically always want Sync
Darryl Miles
01/22/2024, 10:46 PMdeploy(path=":war", configuration="exploded")
and want to allow switching there as well. Expecting "artifacts" to be the standard single file *.war, while "exploded" to be the entire contents of the libs/exploded directory.
Then a toplevel gradle.properties to globally disable for CI.