File tree Expand file tree Collapse file tree 1 file changed +29
-3
lines changed
Expand file tree Collapse file tree 1 file changed +29
-3
lines changed Original file line number Diff line number Diff line change 1+ import java.util.Properties
2+ import java.io.FileInputStream
3+
14plugins {
25 id(" com.android.application" )
36 id(" kotlin-android" )
47 // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
58 id(" dev.flutter.flutter-gradle-plugin" )
69}
710
11+ val keystorePropertiesFile = rootProject.file(" key.properties" )
12+ val keystoreProperties = Properties ().apply {
13+ if (keystorePropertiesFile.exists()) {
14+ load(FileInputStream (keystorePropertiesFile))
15+ }
16+ }
17+
818android {
919 namespace = " dev.shtanko.flutter_bloc_app_template"
1020 compileSdk = flutter.compileSdkVersion
@@ -59,11 +69,27 @@ android {
5969 }
6070 }
6171
72+ signingConfigs {
73+ register(" release" ) {
74+ enableV1Signing = true
75+ enableV2Signing = true
76+
77+ storeFile = keystoreProperties[" storeFile" ]?.let { file(it) }
78+ storePassword = keystoreProperties[" storePassword" ] as String?
79+ keyAlias = keystoreProperties[" keyAlias" ] as String?
80+ keyPassword = keystoreProperties[" keyPassword" ] as String?
81+ }
82+ }
83+
6284 buildTypes {
6385 release {
64- // TODO: Add your own signing config for the release build.
65- // Signing with the debug keys for now, so `flutter run --release` works.
66- signingConfig = signingConfigs.getByName(" debug" )
86+ isMinifyEnabled = true
87+ isShrinkResources = true
88+ proguardFiles(
89+ getDefaultProguardFile(" proguard-android-optimize.txt" ),
90+ " proguard-rules.pro"
91+ )
92+ signingConfig = signingConfigs.getByName(" release" )
6793 }
6894 }
6995}
You can’t perform that action at this time.
0 commit comments