Feature: Add workflow for push/PR checking (#1030)

* Chore: downgrade ndk version

* Fix: fix local.properties load

* Feature: add workflow for push/PR checking
This commit is contained in:
Kr328
2021-05-24 15:20:45 +08:00
parent 1a36218c80
commit 4f05ba1ac6
3 changed files with 38 additions and 7 deletions

View File

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