Created
April 22, 2019 15:18
-
-
Save shekibobo/5fd0f8d6826cbf8c736edb9aaf951f7e to your computer and use it in GitHub Desktop.
Load properties from a given file within the project.
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 propertiesFrom(filename) { | |
def properties = new Properties() | |
def file = rootProject.file(filename) | |
if (file.exists()) { | |
properties.load(new FileInputStream(file)) | |
} else { | |
System.out.println("[WARNING] Properties file ${filename} not found. Returning empty properties.") | |
} | |
return properties | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment