Last active
August 6, 2019 04:06
-
-
Save talenguyen/8e965fd0d29fe59dcf1595d1c876e158 to your computer and use it in GitHub Desktop.
Script to read local 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
def propertiesFile = new File(rootDir, "local.properties") | |
if (propertiesFile.exists()) { | |
def properties = new Properties() | |
properties.load(propertiesFile.newDataInputStream()) | |
if (properties.containsKey("gradleScripts.dir")) { | |
ext.gradleScriptsDir = properties.getProperty("gradleScripts.dir") | |
} else { | |
throw new IllegalArgumentException("ERROR: Gradle Scripts location not found. " + | |
"Define location with gradleScripts.dir in the local.properties file") | |
} | |
} else { | |
throw new IllegalArgumentException("ERROR: Gradle Scripts location not found. " + | |
"Define location with gradleScripts.dir in the local.properties file") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment