-
-
Save anonymous/b1572e80d2e6a40ee1e7 to your computer and use it in GitHub Desktop.
how to DRY
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task warInt (type: War) { | |
def env = 'int' | |
baseName = 'MYAPP' | |
version += "-$env" | |
include("**/log4j_${env}.conf", "**/web_${env}.xml", '**/templates/**') | |
rename("log4j_${env}.conf", 'log4j.conf') | |
rename("web_${env}.xml", 'web.xml') | |
} | |
task warProd (type: War) { | |
def env = 'prod' | |
baseName = 'MYAPP' | |
version += "-$env" | |
include("**/log4j_${env}.conf", "**/web_${env}.xml", '**/templates/**') | |
rename("log4j_${env}.conf", 'log4j.conf') | |
rename("web_${env}.xml", 'web.xml') | |
} | |
task warTest (type: War) { | |
def env = 'test' | |
baseName = 'MYAPP' | |
version += "-$env" | |
include("**/log4j_${env}.conf", "**/web_${env}.xml", '**/templates/**') | |
rename("log4j_${env}.conf", 'log4j.conf') | |
rename("web_${env}.xml", 'web.xml') | |
} | |
task warLocal (type: War) { | |
def env = 'local' | |
baseName = 'MYAPP' | |
version += "-$env" | |
include("**/log4j_${env}.conf", "**/web_${env}.xml", '**/templates/**') | |
rename("log4j_${env}.conf", 'log4j.conf') | |
rename("web_${env}.xml", 'web.xml') | |
} | |
task warAll(dependsOn: [warInt, warProd, warTest]) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment