@@ -77,11 +77,6 @@ android {
7777 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
7878 }
7979
80- signingConfigs {
81- release {
82- }
83- }
84-
8580 buildFeatures {
8681 viewBinding = true
8782 }
@@ -91,7 +86,7 @@ android {
9186 minifyEnabled true
9287 shrinkResources true
9388 proguardFiles getDefaultProguardFile(" proguard-android.txt" )
94- signingConfig signingConfigs . release
89+ signingConfig
9590 }
9691 debug {
9792 applicationIdSuffix " .BETA"
@@ -139,13 +134,20 @@ signingConfig()
139134
140135def signingConfig () {
141136 if (isReleaseTask()) {
142- Properties properties = readProperties(file(" androidkeystore.properties" ))
143-
144- System . out. println (" >>> Signing Config " + properties)
145- android. buildTypes. release. signingConfig. keyAlias = properties[" key_alias" ]. toString()
146- android. buildTypes. release. signingConfig. keyPassword = properties[" key_password" ]. toString()
147- android. buildTypes. release. signingConfig. storeFile = file(properties[" store_filename" ]. toString())
148- android. buildTypes. release. signingConfig. storePassword = properties[" store_password" ]. toString()
137+ def propertiesFile = file(" androidkeystore.properties" )
138+ if (propertiesFile. exists()) {
139+ Properties properties = readProperties(propertiesFile)
140+ System . out. println (" >>> Signing Config " + properties)
141+ android. signingConfigs. create(" releaseConfig" ) {
142+ keyAlias = properties[" key_alias" ]. toString()
143+ keyPassword = properties[" key_password" ]. toString()
144+ storeFile = file(properties[" store_filename" ]. toString())
145+ storePassword = properties[" store_password" ]. toString()
146+ }
147+ android. buildTypes. release. signingConfig = android. signingConfigs. releaseConfig
148+ } else {
149+ System . err. println (" >>> No Signing Config found! Missing '" + propertiesFile. name + " ' file!" )
150+ }
149151 }
150152}
151153
0 commit comments