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 Book - The Commit Stage)
configurations {
provided
testProvided.extendsFrom provided
}
sourceSets {
main {
compileClasspath += configurations.provided
}
test {
compileClasspath += configurations.testProvided
}
}
apply plugin: 'war'
// some 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"
// use the dependency 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]
}