Like any other software system, when build scripts are poorly designed and maintained, the effort to keep them working grows in what seems like an exponential manner.
(Continous Delivery, The Commit Stage)
configurations {
provided
testProvided.extendsFrom provided
}
sourceSets {
main {
compileClasspath += configurations.provided
}
test {
compileClasspath += configurations.testProvided
}
}
apply plugin: 'war'
// some dependencies and build logic here ..
war {
includeEmptyDirs = false
}
war << {
exec {
ignoreExitValue = false
executable 'zipcmp'
args "$projectDir/target/$archiveName", archivePath
}
}
// versions.gradle
project.ext {
escenicEngineVersion = '5.5.4.143753'
}
// dependencyDeclarations.gradle
apply from: "$rootDir/gradle/dependencies/versions.gradle"
project.ext.escenicNativeLibraries = [
engineCore: "com.escenic.engine:engine-core:$escenicEngineVersion"
]
// in build.gradle
apply from: "$rootDir/gradle/dependencies/dependencyDeclarations.gradle"
// dependency can be used in any subproject
compile escenicNativeLibraries.engineCore
// in buildSrc
class Grunt extends DefaultTask {
@Input
List<String> commands
@TaskAction
void callGrunt() {
project.exec {
executable 'grunt'
args commands
}
}
}
// in build.gradle
task installGruntDependencies(type: Exec) {
inputs.file 'package.json'
outputs.file 'node_modules'
executable 'npm'
args 'install'
}
task grunt(type: Grunt, dependsOn: installGruntDependencies) {
commands = [project.name]
}