@@ -2,6 +2,10 @@ apply plugin: 'com.android.application'
22apply plugin : ' kotlin-android'
33apply plugin : ' kotlin-android-extensions'
44
5+ def keystorePropertiesFile = rootProject. file(" keystore.properties" )
6+ def keystoreProperties = new Properties ()
7+ keystoreProperties. load(new FileInputStream (keystorePropertiesFile))
8+
59android {
610 compileSdkVersion 28
711 buildToolsVersion " 28.0.3"
@@ -16,7 +20,12 @@ android {
1620 }
1721
1822 signingConfigs {
19- release
23+ release {
24+ keyAlias keystoreProperties[' keyAlias' ]
25+ keyPassword keystoreProperties[' keyPassword' ]
26+ storeFile file(keystoreProperties[' storeFile' ])
27+ storePassword keystoreProperties[' storePassword' ]
28+ }
2029 }
2130
2231 buildTypes {
@@ -45,22 +54,3 @@ dependencies {
4554 implementation ' com.squareup:otto:1.3.8'
4655 implementation ' androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
4756}
48-
49- Properties props = new Properties ()
50- def propFile = new File (' signing.properties' )
51- if (propFile. canRead()) {
52- props. load(new FileInputStream (propFile))
53-
54- if (props != null && props. containsKey(' STORE_FILE' ) && props. containsKey(' KEY_ALIAS' ) && props. containsKey(' PASSWORD' )) {
55- android. signingConfigs. release. storeFile = file(props[' STORE_FILE' ])
56- android. signingConfigs. release. storePassword = props[' PASSWORD' ]
57- android. signingConfigs. release. keyAlias = props[' KEY_ALIAS' ]
58- android. signingConfigs. release. keyPassword = props[' PASSWORD' ]
59- } else {
60- println ' signing.properties found but some entries are missing'
61- android. buildTypes. release. signingConfig = null
62- }
63- } else {
64- println ' signing.properties not found'
65- android. buildTypes. release. signingConfig = null
66- }
0 commit comments