Allow more control over debug and staging signing.
This commit is contained in:
parent
4c43b0d1e3
commit
49e1ccea28
2 changed files with 38 additions and 6 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,6 +1,8 @@
|
|||
.classpath
|
||||
captures/
|
||||
project.properties
|
||||
keystore.debug.properties
|
||||
keystore.staging.properties
|
||||
.project
|
||||
.settings
|
||||
bin/
|
||||
|
|
|
@ -90,6 +90,9 @@ def abiPostFix = ['universal' : 0,
|
|||
'x86' : 3,
|
||||
'x86_64' : 4]
|
||||
|
||||
def keystores = [ 'debug' : loadKeystoreProperties('keystore.debug.properties'),
|
||||
'staging': loadKeystoreProperties('keystore.staging.properties')]
|
||||
|
||||
android {
|
||||
flavorDimensions "none"
|
||||
compileSdkVersion 29
|
||||
|
@ -101,11 +104,22 @@ android {
|
|||
}
|
||||
|
||||
signingConfigs {
|
||||
staging {
|
||||
storeFile file("${project.rootDir}/dev.keystore")
|
||||
storePassword 'android'
|
||||
keyAlias 'staging'
|
||||
keyPassword 'android'
|
||||
if (keystores['debug'] != null) {
|
||||
debug {
|
||||
storeFile file("${project.rootDir}/${keystores['debug']['storeFile']}")
|
||||
storePassword keystores['debug']['storePassword']
|
||||
keyAlias keystores['debug']['keyAlias']
|
||||
keyPassword keystores['debug']['keyPassword']
|
||||
}
|
||||
}
|
||||
|
||||
if (keystores['staging'] != null) {
|
||||
staging {
|
||||
storeFile file("${project.rootDir}/${keystores['staging']['storeFile']}")
|
||||
storePassword keystores['staging']['storePassword']
|
||||
keyAlias keystores['staging']['keyAlias']
|
||||
keyPassword keystores['staging']['keyPassword']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -180,6 +194,9 @@ android {
|
|||
|
||||
buildTypes {
|
||||
debug {
|
||||
if (keystores['debug'] != null) {
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
minifyEnabled true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'),
|
||||
'proguard/proguard-firebase-messaging.pro',
|
||||
|
@ -206,7 +223,9 @@ android {
|
|||
staging {
|
||||
initWith debug
|
||||
applicationIdSuffix ".staging"
|
||||
signingConfig signingConfigs.staging
|
||||
if (keystores['staging'] != null) {
|
||||
signingConfig signingConfigs.staging
|
||||
}
|
||||
|
||||
buildConfigField "String", "SIGNAL_URL", "\"https://textsecure-service-staging.whispersystems.org\""
|
||||
buildConfigField "String", "STORAGE_URL", "\"https://storage-staging.signal.org\""
|
||||
|
@ -490,3 +509,14 @@ tasks.withType(Test) {
|
|||
showStackTraces true
|
||||
}
|
||||
}
|
||||
|
||||
def loadKeystoreProperties(filename) {
|
||||
def keystorePropertiesFile = file("${project.rootDir}/${filename}")
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
def keystoreProperties = new Properties()
|
||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||
return keystoreProperties;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue