Improved handling of signing keys
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
^botejars/libs
|
^botejars/libs
|
||||||
lint.xml
|
lint.xml
|
||||||
local.properties
|
local.properties
|
||||||
signing.gradle
|
signing.properties
|
||||||
|
|
||||||
#IntelliJ IDEA
|
#IntelliJ IDEA
|
||||||
^.idea
|
^.idea
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
apply plugin: 'android'
|
apply plugin: 'android'
|
||||||
apply from: 'signing.gradle'
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 19
|
compileSdkVersion 19
|
||||||
@@ -8,6 +7,9 @@ android {
|
|||||||
minSdkVersion 9
|
minSdkVersion 9
|
||||||
targetSdkVersion 19
|
targetSdkVersion 19
|
||||||
}
|
}
|
||||||
|
signingConfigs {
|
||||||
|
release
|
||||||
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
@@ -31,3 +33,27 @@ dependencies {
|
|||||||
exclude group: 'com.android.support', module: 'support-v4'
|
exclude group: 'com.android.support', module: 'support-v4'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def Properties props = new Properties()
|
||||||
|
def propFile = new File(project.rootDir, 'signing.properties')
|
||||||
|
|
||||||
|
if (propFile.canRead()) {
|
||||||
|
props.load(new FileInputStream(propFile))
|
||||||
|
|
||||||
|
if (props != null &&
|
||||||
|
props.containsKey('STORE_FILE') &&
|
||||||
|
props.containsKey('STORE_PASSWORD') &&
|
||||||
|
props.containsKey('KEY_ALIAS') &&
|
||||||
|
props.containsKey('KEY_PASSWORD')) {
|
||||||
|
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
|
||||||
|
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
|
||||||
|
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
|
||||||
|
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
|
||||||
|
} else {
|
||||||
|
println 'signing.properties found but some entries are missing'
|
||||||
|
android.buildTypes.release.signingConfig = null
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
println 'signing.properties not found'
|
||||||
|
android.buildTypes.release.signingConfig = null
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user