Skip to content

Instantly share code, notes, and snippets.

@shekibobo
Created April 22, 2019 15:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shekibobo/5fd0f8d6826cbf8c736edb9aaf951f7e to your computer and use it in GitHub Desktop.
Save shekibobo/5fd0f8d6826cbf8c736edb9aaf951f7e to your computer and use it in GitHub Desktop.
Load properties from a given file within the project.
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