From f04840611a7a87b9ff4402a0626d3d52965d35e3 Mon Sep 17 00:00:00 2001 From: Naman Anand Date: Mon, 14 Jul 2025 15:46:30 +0530 Subject: [PATCH 1/2] remove dep on local.properties Signed-off-by: Naman Anand --- sdks/android/app/build.gradle | 21 ++++++++++++------- .../android/buildSrc/src/main/kotlin/Utils.kt | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/sdks/android/app/build.gradle b/sdks/android/app/build.gradle index 87fb9b75..1dfcf6ae 100644 --- a/sdks/android/app/build.gradle +++ b/sdks/android/app/build.gradle @@ -22,12 +22,15 @@ if (propertiesFile.exists()) { android { signingConfigs { - externalRelease { - storeFile file(localProperties.getProperty('storeFile')) - storePassword localProperties.getProperty('storePassword') - keyPassword localProperties.getProperty('keyPassword') - keyAlias localProperties.getProperty('keyAlias') - } + +// Uncomment for sample app release build: +// +// externalRelease { +// storeFile file(localProperties.getProperty('storeFile')) +// storePassword localProperties.getProperty('storePassword') +// keyPassword localProperties.getProperty('keyPassword') +// keyAlias localProperties.getProperty('keyAlias') +// } } namespace 'dev.deliteai.android.sampleapp' @@ -41,7 +44,7 @@ android { versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - signingConfig signingConfigs.externalRelease + vectorDrawables { useSupportLibrary true } @@ -53,7 +56,9 @@ android { buildTypes { release { - signingConfig signingConfigs.externalRelease +// Uncomment for sample app release build: +// signingConfig signingConfigs.externalRelease + minifyEnabled true shrinkResources true debuggable false diff --git a/sdks/android/buildSrc/src/main/kotlin/Utils.kt b/sdks/android/buildSrc/src/main/kotlin/Utils.kt index 5dfd7f01..0564ea44 100644 --- a/sdks/android/buildSrc/src/main/kotlin/Utils.kt +++ b/sdks/android/buildSrc/src/main/kotlin/Utils.kt @@ -28,7 +28,7 @@ fun Project.getLocalProperty(key: String): String { val propsFile = rootProject.file("local.properties") val props = Properties().apply { if (propsFile.exists()) load(propsFile.inputStream()) } return props.getProperty(key) - ?: throw GradleException("Missing local property: $key") + ?: "" } fun fetchLocalProperties(rootDir: File) = From f10101ed2fea03c6b420d5f074d42c426cc88cad Mon Sep 17 00:00:00 2001 From: Naman Anand Date: Mon, 14 Jul 2025 16:40:50 +0530 Subject: [PATCH 2/2] remove localProperties load duplication Signed-off-by: Naman Anand --- sdks/android/app/build.gradle | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sdks/android/app/build.gradle b/sdks/android/app/build.gradle index 1dfcf6ae..0796c0e2 100644 --- a/sdks/android/app/build.gradle +++ b/sdks/android/app/build.gradle @@ -10,10 +10,6 @@ plugins { id "org.jetbrains.kotlin.plugin.compose" } -def executedTask = gradle.startParameter.taskNames.toString() -def localProps = new Properties() -localProps.load(new FileInputStream(rootProject.file("local.properties"))) - Properties localProperties = new Properties() def propertiesFile = project.rootProject.file('local.properties') if (propertiesFile.exists()) { @@ -49,16 +45,16 @@ android { useSupportLibrary true } - buildConfigField "String", "APP_CLIENT_ID", "\"${localProps['APP_CLIENT_ID']}\"" - buildConfigField "String", "APP_CLIENT_SECRET", "\"${localProps['APP_CLIENT_SECRET']}\"" - buildConfigField "String", "APP_HOST", "\"${localProps['APP_HOST']}\"" + buildConfigField "String", "APP_CLIENT_ID", "\"${localProperties['APP_CLIENT_ID']}\"" + buildConfigField "String", "APP_CLIENT_SECRET", "\"${localProperties['APP_CLIENT_SECRET']}\"" + buildConfigField "String", "APP_HOST", "\"${localProperties['APP_HOST']}\"" } buildTypes { release { // Uncomment for sample app release build: // signingConfig signingConfigs.externalRelease - + minifyEnabled true shrinkResources true debuggable false