Skip to content

Instantly share code, notes, and snippets.

@ExFed
Last active February 27, 2019 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ExFed/d14cabee15bedd3233e6675afd291266 to your computer and use it in GitHub Desktop.
Save ExFed/d14cabee15bedd3233e6675afd291266 to your computer and use it in GitHub Desktop.
Gradle Sub-Project Property Overrides
// biz/props.gradle
project.ext.fullName = 'biz baz'
defaultTasks 'hello'
subprojects {
if (file('props.gradle').exists()) {
apply from: 'props.gradle'
}
project.ext {
if (!project.hasProperty('fullName')) {
fullName = project.name
}
}
task hello {
println "Hello! My name is $project.fullName"
}
}
// foo/props.gradle
project.ext.fullName = 'foo bar'
include 'biz'
include 'foo'
include 'xyzzy'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment