diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index ee57fee..a2584c0 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -1,3 +1,6 @@ +import java.util.Properties +import java.io.FileInputStream + plugins { id("com.android.application") id("kotlin-android") @@ -5,6 +8,12 @@ plugins { id("dev.flutter.flutter-gradle-plugin") } +val keystorePropertiesFile = rootProject.file("key.properties") +val keystoreProperties = Properties() +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(FileInputStream(keystorePropertiesFile)) +} + android { namespace = "gmbh.bearologics.brandmanager" compileSdk = flutter.compileSdkVersion @@ -19,6 +28,15 @@ android { jvmTarget = JavaVersion.VERSION_17.toString() } + signingConfigs { + create("release") { + keyAlias = keystoreProperties["keyAlias"] as String? + keyPassword = keystoreProperties["keyPassword"] as String? + storeFile = keystoreProperties["storeFile"]?.let { file(it) } + storePassword = keystoreProperties["storePassword"] as String? + } + } + defaultConfig { applicationId = "gmbh.bearologics.brandmanager" // You can update the following values to match your application needs. @@ -31,9 +49,7 @@ android { buildTypes { release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig = signingConfigs.getByName("debug") + signingConfig = signingConfigs.getByName("release") } } }