Reputation: 1701
For my web project I need to build two WAR files. One with the static content, one without.
war {
archiveName = "feeder##${version}.full.war"
exclude 'test.html', 'test.js', 'todos.js'
}
task SmallWar(type: War, dependsOn:[war]) {
// exclude 'css', 'img', 'js', 'template', 'index.html'
archiveName = "feeder##${version}.war"
}
It's clear, I'm able to configure both the same way, but how can I take over the configuration and enhance it?
The current configuration only calls war
before running SmallWar
.
I don't want to call it. Instead the SmallWar
task should already exclude the same files as the war plus additional files.
Upvotes: 1
Views: 448
Reputation: 123900
The dependsOn
only affects execution, not configuration. An easy way to configure commonalities between the two War
tasks is:
tasks.withType(War) {
exclude 'test.html', 'test.js', 'todos.js'
}
smallWar
can then add further excludes:
task smallWar(type: War) {
exclude 'css', 'img', 'js'
}
Upvotes: 2