Created
March 20, 2014 14:31
-
-
Save venkatperi/9664988 to your computer and use it in GitHub Desktop.
Walk up project tree to resolve project (ext) properties in Gradle
This file contains 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
//root build.gradle | |
ext { | |
javaVersion = JavaVersion.VERSION_1_7 | |
} | |
Project.metaClass.prop { name -> | |
delegate.with { | |
ext.properties.containsKey( name ) ? | |
ext.properties[ name ] : parent?.prop( name ) | |
} | |
} | |
//:subproject1 build.gradle | |
sourceCompatibility = prop("javaVersion") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wish
gradle :properties
had a recursive option to automate this.