diff --git a/app/build.gradle.kts b/app/build.gradle.kts index eac9791..cd160c9 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,3 +1,6 @@ +import java.util.Properties +import java.io.FileInputStream + plugins { alias(libs.plugins.android.application) alias(libs.plugins.kotlin.compose) @@ -5,6 +8,13 @@ plugins { alias(libs.plugins.hilt) } +val keystorePropertiesFile = rootProject.file("key.properties") +val keystoreProperties = Properties().apply { + if (keystorePropertiesFile.exists()) { + load(FileInputStream(keystorePropertiesFile)) + } +} + android { namespace = "de.jeanlucmakiola.calendula" compileSdk = 37 @@ -19,6 +29,17 @@ android { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } + signingConfigs { + if (keystorePropertiesFile.exists()) { + create("release") { + keyAlias = keystoreProperties["keyAlias"] as String + keyPassword = keystoreProperties["keyPassword"] as String + storeFile = file(keystoreProperties["storeFile"] as String) + storePassword = keystoreProperties["storePassword"] as String + } + } + } + buildTypes { release { isMinifyEnabled = true @@ -27,6 +48,9 @@ android { getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) + if (keystorePropertiesFile.exists()) { + signingConfig = signingConfigs.getByName("release") + } } debug { applicationIdSuffix = ".debug"