Move res values from build.gradle into strings.xml

This fixes an issue where the build type values were overriding the
flavor values.
This commit is contained in:
Torsten Grote
2018-08-03 13:08:18 -03:00
parent cc6041e90c
commit edb8e8f9d0
5 changed files with 30 additions and 22 deletions

View File

@@ -264,8 +264,6 @@ android {
versionCode 10013
versionName "1.0.13"
applicationId "org.briarproject.briar.android"
resValue "string", "app_package", "org.briarproject.briar.android"
resValue "string", "app_name", "Briar"
buildConfigField "String", "GitHash",
"\"${getStdout(['git', 'rev-parse', '--short=7', 'HEAD'], 'No commit hash')}\""
def now = (long) (System.currentTimeMillis() / 1000)
@@ -274,29 +272,9 @@ android {
testInstrumentationRunner 'org.briarproject.briar.android.test.BriarTestRunner'
}
flavorDimensions "version"
productFlavors {
screenshot {
dimension "version"
minSdkVersion 18
applicationIdSuffix ".screenshot"
resValue "string", "app_package", "org.briarproject.briar.android.screenshot.debug"
}
main {
dimension "version"
}
}
variantFilter { variant ->
if (variant.flavors*.name.contains("screenshot") && variant.buildType.name == "release") {
setIgnore(true)
}
}
buildTypes {
debug {
applicationIdSuffix ".debug"
resValue "string", "app_package", "org.briarproject.briar.android.debug"
resValue "string", "app_name", "Briar Debug"
shrinkResources false
minifyEnabled true
crunchPngs false
@@ -311,6 +289,23 @@ android {
}
}
flavorDimensions "version"
productFlavors {
screenshot {
dimension "version"
minSdkVersion 18
applicationIdSuffix ".screenshot" // = org.briarproject.briar.android.screenshot.debug
}
main {
dimension "version"
}
}
variantFilter { variant ->
if (variant.flavors*.name.contains("screenshot") && variant.buildType.name == "release") {
setIgnore(true)
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name" translatable="false">Briar Debug</string>
<string name="app_package" translatable="false">org.briarproject.briar.android.debug</string>
</resources>

View File

@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name" translatable="false">Briar</string>
<string name="app_package" translatable="false">org.briarproject.briar.android</string>
<!-- Setup -->
<string name="setup_title">Welcome to Briar</string>
<string name="setup_name_explanation">Your nickname will be shown next to any content you post. You can\'t change it after creating your account.</string>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name" translatable="false">Briar</string>
<string name="app_package" translatable="false">org.briarproject.briar.android.screenshot.debug</string>
</resources>