Просмотр исходного кода

Chore: should ignore appcenter.key in foss build

Kr328 4 лет назад
Родитель
Сommit
eff310ac40
1 измененных файлов с 7 добавлено и 5 удалено
  1. 7 5
      app/build.gradle.kts

+ 7 - 5
app/build.gradle.kts

@@ -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\"")
+            }
         }
     }