Improve: remove tracking for flavor 'foss'

This commit is contained in:
kr328
2021-05-16 18:15:36 +08:00
parent 45ab647c67
commit 0b69bf735e
5 changed files with 60 additions and 42 deletions

View File

@@ -45,6 +45,14 @@ android {
create("premium") {
dimension = "premium"
versionNameSuffix = ".premium"
val appCenterKey = rootProject.file("local.properties").inputStream()
.use { Properties().apply { load(it) } }
.getProperty("appcenter.key", null)
Objects.requireNonNull(appCenterKey)
buildConfigField("String", "APP_CENTER_KEY", "\"$appCenterKey\"")
}
}
@@ -89,32 +97,19 @@ android {
isUniversalApk = true
}
}
buildTypes.apply {
val properties = Properties().apply {
rootProject.file("local.properties").inputStream().use {
load(it)
}
}
val key = properties.getProperty("appcenter.key", null)
forEach {
if (it.name == "debug" || key == null) {
it.buildConfigField("String", "APP_CENTER_KEY", "null")
} else {
it.buildConfigField("String", "APP_CENTER_KEY", "\"$key\"")
}
}
}
}
dependencies {
val premiumImplementation by configurations
api(project(":core"))
api(project(":service"))
api(project(":design"))
api(project(":common"))
premiumImplementation("com.microsoft.appcenter:appcenter-analytics:$appcenterVersion")
premiumImplementation("com.microsoft.appcenter:appcenter-crashes:$appcenterVersion")
implementation(kotlin("stdlib-jdk7"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion")
implementation("androidx.core:core-ktx:$ktxVersion")
@@ -123,8 +118,6 @@ dependencies {
implementation("androidx.coordinatorlayout:coordinatorlayout:$coordinatorlayoutVersion")
implementation("androidx.recyclerview:recyclerview:$recyclerviewVersion")
implementation("androidx.fragment:fragment:$fragmentVersion")
implementation("com.microsoft.appcenter:appcenter-analytics:$appcenterVersion")
implementation("com.microsoft.appcenter:appcenter-crashes:$appcenterVersion")
implementation("com.google.android.material:material:$materialVersion")
}