mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-26 02:58:08 +00:00
Add environment dimension.
This commit is contained in:
108
app/build.gradle
108
app/build.gradle
@@ -90,11 +90,10 @@ def abiPostFix = ['universal' : 0,
|
|||||||
'x86' : 3,
|
'x86' : 3,
|
||||||
'x86_64' : 4]
|
'x86_64' : 4]
|
||||||
|
|
||||||
def keystores = [ 'debug' : loadKeystoreProperties('keystore.debug.properties'),
|
def keystores = [ 'debug' : loadKeystoreProperties('keystore.debug.properties') ]
|
||||||
'staging': loadKeystoreProperties('keystore.staging.properties')]
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
flavorDimensions "none"
|
flavorDimensions 'distribution', 'environment'
|
||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
buildToolsVersion '29.0.3'
|
buildToolsVersion '29.0.3'
|
||||||
useLibrary 'org.apache.http.legacy'
|
useLibrary 'org.apache.http.legacy'
|
||||||
@@ -104,21 +103,12 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
if (keystores['debug'] != null) {
|
if (keystores.debug != null) {
|
||||||
debug {
|
debug {
|
||||||
storeFile file("${project.rootDir}/${keystores['debug']['storeFile']}")
|
storeFile file("${project.rootDir}/${keystores.debug.storeFile}")
|
||||||
storePassword keystores['debug']['storePassword']
|
storePassword keystores.debug.storePassword
|
||||||
keyAlias keystores['debug']['keyAlias']
|
keyAlias keystores.debug.keyAlias
|
||||||
keyPassword keystores['debug']['keyPassword']
|
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']
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -197,6 +187,7 @@ android {
|
|||||||
if (keystores['debug'] != null) {
|
if (keystores['debug'] != null) {
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.debug
|
||||||
}
|
}
|
||||||
|
isDefault true
|
||||||
minifyEnabled true
|
minifyEnabled true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'),
|
proguardFiles getDefaultProguardFile('proguard-android.txt'),
|
||||||
'proguard/proguard-firebase-messaging.pro',
|
'proguard/proguard-firebase-messaging.pro',
|
||||||
@@ -220,12 +211,50 @@ android {
|
|||||||
testProguardFiles 'proguard/proguard-automation.pro',
|
testProguardFiles 'proguard/proguard-automation.pro',
|
||||||
'proguard/proguard.cfg'
|
'proguard/proguard.cfg'
|
||||||
}
|
}
|
||||||
staging {
|
flipper {
|
||||||
initWith debug
|
initWith debug
|
||||||
|
isDefault false
|
||||||
|
minifyEnabled false
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles = buildTypes.debug.proguardFiles
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
productFlavors {
|
||||||
|
play {
|
||||||
|
dimension 'distribution'
|
||||||
|
isDefault true
|
||||||
|
ext.websiteUpdateUrl = "null"
|
||||||
|
buildConfigField "boolean", "PLAY_STORE_DISABLED", "false"
|
||||||
|
buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl"
|
||||||
|
}
|
||||||
|
|
||||||
|
website {
|
||||||
|
dimension 'distribution'
|
||||||
|
ext.websiteUpdateUrl = "https://updates.signal.org/android"
|
||||||
|
buildConfigField "boolean", "PLAY_STORE_DISABLED", "true"
|
||||||
|
buildConfigField "String", "NOPLAY_UPDATE_URL", "\"$ext.websiteUpdateUrl\""
|
||||||
|
}
|
||||||
|
|
||||||
|
internal {
|
||||||
|
dimension 'distribution'
|
||||||
|
ext.websiteUpdateUrl = "null"
|
||||||
|
buildConfigField "boolean", "PLAY_STORE_DISABLED", "false"
|
||||||
|
buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl"
|
||||||
|
}
|
||||||
|
|
||||||
|
prod {
|
||||||
|
dimension 'environment'
|
||||||
|
|
||||||
|
isDefault true
|
||||||
|
}
|
||||||
|
|
||||||
|
staging {
|
||||||
|
dimension 'environment'
|
||||||
|
|
||||||
applicationIdSuffix ".staging"
|
applicationIdSuffix ".staging"
|
||||||
if (keystores['staging'] != null) {
|
|
||||||
signingConfig signingConfigs.staging
|
|
||||||
}
|
|
||||||
|
|
||||||
buildConfigField "String", "SIGNAL_URL", "\"https://textsecure-service-staging.whispersystems.org\""
|
buildConfigField "String", "SIGNAL_URL", "\"https://textsecure-service-staging.whispersystems.org\""
|
||||||
buildConfigField "String", "STORAGE_URL", "\"https://storage-staging.signal.org\""
|
buildConfigField "String", "STORAGE_URL", "\"https://storage-staging.signal.org\""
|
||||||
@@ -241,37 +270,6 @@ android {
|
|||||||
buildConfigField "String", "UNIDENTIFIED_SENDER_TRUST_ROOT", "\"BbqY1DzohE4NUZoVF+L18oUPrK3kILllLEJh2UnPSsEx\""
|
buildConfigField "String", "UNIDENTIFIED_SENDER_TRUST_ROOT", "\"BbqY1DzohE4NUZoVF+L18oUPrK3kILllLEJh2UnPSsEx\""
|
||||||
buildConfigField "String", "ZKGROUP_SERVER_PUBLIC_PARAMS", "\"ABSY21VckQcbSXVNCGRYJcfWHiAMZmpTtTELcDmxgdFbtp/bWsSxZdMKzfCp8rvIs8ocCU3B37fT3r4Mi5qAemeGeR2X+/YmOGR5ofui7tD5mDQfstAI9i+4WpMtIe8KC3wU5w3Inq3uNWVmoGtpKndsNfwJrCg0Hd9zmObhypUnSkfYn2ooMOOnBpfdanRtrvetZUayDMSC5iSRcXKpdls=\""
|
buildConfigField "String", "ZKGROUP_SERVER_PUBLIC_PARAMS", "\"ABSY21VckQcbSXVNCGRYJcfWHiAMZmpTtTELcDmxgdFbtp/bWsSxZdMKzfCp8rvIs8ocCU3B37fT3r4Mi5qAemeGeR2X+/YmOGR5ofui7tD5mDQfstAI9i+4WpMtIe8KC3wU5w3Inq3uNWVmoGtpKndsNfwJrCg0Hd9zmObhypUnSkfYn2ooMOOnBpfdanRtrvetZUayDMSC5iSRcXKpdls=\""
|
||||||
}
|
}
|
||||||
flipper {
|
|
||||||
initWith debug
|
|
||||||
minifyEnabled false
|
|
||||||
}
|
|
||||||
release {
|
|
||||||
minifyEnabled true
|
|
||||||
proguardFiles = buildTypes.debug.proguardFiles
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
productFlavors {
|
|
||||||
play {
|
|
||||||
dimension "none"
|
|
||||||
ext.websiteUpdateUrl = "null"
|
|
||||||
buildConfigField "boolean", "PLAY_STORE_DISABLED", "false"
|
|
||||||
buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl"
|
|
||||||
}
|
|
||||||
|
|
||||||
website {
|
|
||||||
dimension "none"
|
|
||||||
ext.websiteUpdateUrl = "https://updates.signal.org/android"
|
|
||||||
buildConfigField "boolean", "PLAY_STORE_DISABLED", "true"
|
|
||||||
buildConfigField "String", "NOPLAY_UPDATE_URL", "\"$ext.websiteUpdateUrl\""
|
|
||||||
}
|
|
||||||
|
|
||||||
internal {
|
|
||||||
dimension "none"
|
|
||||||
ext.websiteUpdateUrl = "null"
|
|
||||||
buildConfigField "boolean", "PLAY_STORE_DISABLED", "false"
|
|
||||||
buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
android.applicationVariants.all { variant ->
|
android.applicationVariants.all { variant ->
|
||||||
@@ -423,7 +421,7 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencyVerification {
|
dependencyVerification {
|
||||||
configuration = '(play|website)(Debug|Release)RuntimeClasspath'
|
configuration = '(play|website)(Prod|Staging)(Debug|Release)RuntimeClasspath'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -470,13 +468,13 @@ def signProductionRelease = { variant ->
|
|||||||
|
|
||||||
task signProductionPlayRelease {
|
task signProductionPlayRelease {
|
||||||
doLast {
|
doLast {
|
||||||
signProductionRelease(android.applicationVariants.find { (it.name == 'playRelease') })
|
signProductionRelease(android.applicationVariants.find { (it.name == 'playProdRelease') })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task signProductionInternalRelease {
|
task signProductionInternalRelease {
|
||||||
doLast {
|
doLast {
|
||||||
signProductionRelease(android.applicationVariants.find { (it.name == 'internalRelease') })
|
signProductionRelease(android.applicationVariants.find { (it.name == 'internalProdRelease') })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,8 +19,8 @@ subprojects {
|
|||||||
task qa {
|
task qa {
|
||||||
group 'Verification'
|
group 'Verification'
|
||||||
description 'Quality Assurance. Run before pushing.'
|
description 'Quality Assurance. Run before pushing.'
|
||||||
dependsOn ':Signal-Android:testPlayReleaseUnitTest',
|
dependsOn ':Signal-Android:testPlayProdReleaseUnitTest',
|
||||||
':Signal-Android:lintPlayRelease',
|
':Signal-Android:lintPlayProdRelease',
|
||||||
':libsignal-service:test',
|
':libsignal-service:test',
|
||||||
':Signal-Android:assemblePlayDebug'
|
':Signal-Android:assemblePlayProdDebug'
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user