Skip to content

Commit 63d965d

Browse files
committed
config: sign config
1 parent 2d744bc commit 63d965d

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ lib/generated_plugin_registrant.dart
3535

3636
# Exceptions to above rules.
3737
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
38+
android/key.properties

android/app/build.gradle

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ apply plugin: 'com.android.application'
2525
apply plugin: 'kotlin-android'
2626
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2727

28+
def keystoreProperties = new Properties()
29+
def keystorePropertiesFile = rootProject.file('key.properties')
30+
if (keystorePropertiesFile.exists()) {
31+
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
32+
}
33+
2834
android {
2935
compileSdkVersion 29
3036

@@ -46,11 +52,20 @@ android {
4652
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4753
}
4854

55+
signingConfigs {
56+
release {
57+
keyAlias keystoreProperties['keyAlias']
58+
keyPassword keystoreProperties['keyPassword']
59+
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
60+
storePassword keystoreProperties['storePassword']
61+
}
62+
}
63+
4964
buildTypes {
5065
release {
5166
// TODO: Add your own signing config for the release build.
5267
// Signing with the debug keys for now, so `flutter run --release` works.
53-
signingConfig signingConfigs.debug
68+
signingConfig signingConfigs.release
5469
}
5570
}
5671
}

0 commit comments

Comments
 (0)