Chore: should ignore appcenter.key in foss build

This commit is contained in:
Kr328 2021-05-20 10:59:54 +08:00
parent c245fc6dfa
commit eff310ac40

View File

@ -47,13 +47,15 @@ android {
dimension = "premium"
versionNameSuffix = ".premium"
val appCenterKey = rootProject.file("local.properties").inputStream()
.use { Properties().apply { load(it) } }
.getProperty("appcenter.key", null)
if (buildFlavor == "premium") {
val appCenterKey = rootProject.file("local.properties").inputStream()
.use { Properties().apply { load(it) } }
.getProperty("appcenter.key", null)
Objects.requireNonNull(appCenterKey)
Objects.requireNonNull(appCenterKey)
buildConfigField("String", "APP_CENTER_KEY", "\"$appCenterKey\"")
buildConfigField("String", "APP_CENTER_KEY", "\"$appCenterKey\"")
}
}
}