Skip to content

Commit

Permalink
fix: remove possible cause for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
charliemangano committed Nov 9, 2024
1 parent fd4f5c5 commit 4bd72da
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import java.io.FileInputStream
import java.util.Properties

plugins {
// supabase setup
kotlin("plugin.serialization") version "2.0.0-RC1"
Expand All @@ -16,20 +13,25 @@ plugins {
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
}

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

android {
namespace = "com.android.periodpals"
compileSdk = 34

// Load the API key from apikeys.properties
val apikeysProperties = Properties()
val localPropertiesFile = rootProject.file("apikeys.properties")
if (localPropertiesFile.exists()) {
apikeysProperties.load(FileInputStream(localPropertiesFile))
}
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"
// // Load the API key from apikeys.properties
// val apikeysProperties = Properties()
// val localPropertiesFile = rootProject.file("apikeys.properties")
// if (localPropertiesFile.exists()) {
// apikeysProperties.load(FileInputStream(localPropertiesFile))
// }
// 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 @@ -41,10 +43,10 @@ android {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables { useSupportLibrary = true }

buildConfigField("String", "SUPABASE_URL", "\"${supabaseUrl}\"")
buildConfigField("String", "SUPABASE_KEY", "\"${supabaseKey}\"")
buildConfigField("String", "POWERSYNC_URL", "\"${powersyncUrl}\"")
buildConfigField("String", "SERVICE_KEY", "\"${serviceKey}\"")
// 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 Expand Up @@ -115,11 +117,6 @@ android {
}
}

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

sonar {
properties {
property("sonar.projectKey", "PeriodPals_periodpals")
Expand Down

0 comments on commit 4bd72da

Please sign in to comment.