Last active
January 9, 2018 18:40
-
-
Save Jthomas54/f8d73733b87afd278f2a3ae4c68b8548 to your computer and use it in GitHub Desktop.
Gradle helper functions for loading properties file and merging into project properties
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
loadExternalProperties('version.properties') | |
def loadExternalProperties(fileName) { | |
def Properties props = new Properties() | |
file(fileName).withInputStream { stream -> | |
props.load stream | |
props.each { prop -> | |
project.ext[prop.key] = prop.value | |
} | |
stream.close() | |
} | |
} |
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
buildVersion=1 | |
versionString=1.0.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This would allow you to use project.buildVersion to access the values.