Last active
February 27, 2019 04:11
-
-
Save ExFed/d14cabee15bedd3233e6675afd291266 to your computer and use it in GitHub Desktop.
Gradle Sub-Project Property Overrides
This file contains hidden or 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
// biz/props.gradle | |
project.ext.fullName = 'biz baz' |
This file contains hidden or 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
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" | |
} | |
} |
This file contains hidden or 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
// foo/props.gradle | |
project.ext.fullName = 'foo bar' |
This file contains hidden or 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
include 'biz' | |
include 'foo' | |
include 'xyzzy' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment