Only load config prop when needed

Close #922
This commit is contained in:
topjohnwu 2019-02-28 23:41:02 -05:00
parent ec3c43faf1
commit 05dd5f3396

View File

@ -1,8 +1,10 @@
apply plugin: 'com.android.application'
def configProps = new Properties()
def configPath = project.hasProperty('configPath') ? project.configPath : rootProject.file('config.prop')
configProps.load(new FileInputStream(configPath))
def configPath = project.hasProperty('configPath') ?
new File(project.configPath) : rootProject.file('config.prop')
if (configPath.exists())
configPath.withInputStream { is -> configProps.load(is) }
android {
defaultConfig {