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' apply plugin: 'com.android.application'
def configProps = new Properties() def configProps = new Properties()
def configPath = project.hasProperty('configPath') ? project.configPath : rootProject.file('config.prop') def configPath = project.hasProperty('configPath') ?
configProps.load(new FileInputStream(configPath)) new File(project.configPath) : rootProject.file('config.prop')
if (configPath.exists())
configPath.withInputStream { is -> configProps.load(is) }
android { android {
defaultConfig { defaultConfig {