Skip to content

Instantly share code, notes, and snippets.

@ae6rt
Last active December 31, 2015 20:59
Show Gist options
  • Save ae6rt/8043435 to your computer and use it in GitHub Desktop.
Save ae6rt/8043435 to your computer and use it in GitHub Desktop.
In a multiproject Gradle build with potentially empty intermediate directories, here is how to avoid empty build/ directories. Only apply the java plugin to directories containing actual source.
afterEvaluate { project ->
configure(subprojects.findAll { new File(it.projectDir, "src").exists() }) {
apply plugin: 'java'
compileJava {
options.compilerArgs << '-Xlint:unchecked'
}
sourceCompatibility = targetCompatibility = 1.6
tasks.withType(Test) {
systemProperties = System.getProperties()
jvmArgs '-Xmx1g'
testLogging {
showStandardStreams = true
exceptionFormat "full"
events "failed", "standardOut", "standardError"
}
}
tasks.withType(Compile) {
options.encoding = 'UTF-8'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment