Kaynağa Gözat

Chore: should ignore appcenter.key in foss build

Kr328 4 yıl önce
ebeveyn
işleme
eff310ac40
1 değiştirilmiş dosya ile 7 ekleme ve 5 silme
  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\"")
+            }
         }
     }