Skip to content

Commit

Permalink
fix: fix Secrets Gradle plugin can't find the secrets issue
Browse files Browse the repository at this point in the history
As we are using `apikeys.properties` and not the plugin default `local.properties`, had to manually set it as the source.
  • Loading branch information
charliemangano committed Nov 9, 2024
1 parent 845cfea commit 41f7c04
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ plugins {
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
}

secrets { defaultPropertiesFileName = "apikeys.defaults.properties" }
secrets {
propertiesFileName = "apikeys.properties"
defaultPropertiesFileName = "apikeys.defaults.properties"
}

android {
namespace = "com.android.periodpals"
Expand All @@ -28,8 +31,10 @@ android {
if (localPropertiesFile.exists()) {
apikeysProperties.load(FileInputStream(localPropertiesFile))
}
val supabaseUrl = apikeysProperties.getProperty("SUPABASE_URL") ?: ""
val supabaseKey = apikeysProperties.getProperty("SUPABASE_KEY") ?: ""
val supabaseUrl = apikeysProperties.getProperty("SUPABASE_URL") ?: "couldnt get property"
val supabaseKey = apikeysProperties.getProperty("SUPABASE_KEY") ?: "couldnt get property"
val powersyncUrl = apikeysProperties.getProperty("POWERSYNC_URL") ?: "couldnt get property"
val serviceKey = apikeysProperties.getProperty("SERVICE_KEY") ?: "couldnt get property"

defaultConfig {
applicationId = "com.android.periodpals"
Expand All @@ -43,6 +48,8 @@ android {

buildConfigField("String", "SUPABASE_URL", "\"${supabaseUrl}\"")
buildConfigField("String", "SUPABASE_KEY", "\"${supabaseKey}\"")
buildConfigField("String", "POWERSYNC_URL", "\"${powersyncUrl}\"")
buildConfigField("String", "SERVICE_KEY", "\"${serviceKey}\"")
}

buildFeatures { buildConfig = true }
Expand Down

0 comments on commit 41f7c04

Please sign in to comment.