enrecipes/platforms/android/gradle-helpers/user_properties_reader.gradle

22 lines
491 B
Groovy
Raw Normal View History

2020-12-01 07:11:41 +00:00
def GRADLE_PROPERTIES_FILENAME = "gradle.properties"
def getFile = { dir, filename ->
File file = new File("$dir$File.separator$filename")
file?.exists() ? file : null
}
def getPropertyFile = { dir ->
return getFile(dir, GRADLE_PROPERTIES_FILENAME)
}
ext.getUserProperties = { dir ->
def file = getPropertyFile(dir)
if (!file) {
return null
}
Properties properties = new Properties()
properties.load(file.newInputStream())
return properties
}