Skip to content

Commit

Permalink
Updated flavor definition to allow resource separation and handle sep…
Browse files Browse the repository at this point in the history
…arate translation management
  • Loading branch information
aanorbel committed Nov 18, 2023
1 parent bb5f327 commit 0660a6e
Show file tree
Hide file tree
Showing 63 changed files with 207 additions and 559 deletions.
37 changes: 24 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,20 @@ android {
}
}

flavorDimensions 'testing', 'license'
flavorDimensions = ['provider', 'testing', 'license']

productFlavors {
ooni {
dimension 'provider'
}
dw {
dimension 'provider'
applicationId 'com.dw.ooniprobe'
resValue "string", "APP_ID", 'com.dw.ooniprobe'
resValue "string", "APP_NAME", "News Media Scan"
buildConfigField 'String', 'BASE_SOFTWARE_NAME', '"news-media-scan-android"'
buildConfigField "boolean", "SHOW_DISABLED_CARDS", "false"
}
stable {
dimension 'testing'
buildConfigField 'String', 'BASE_SOFTWARE_NAME', '"ooniprobe-android"'
Expand All @@ -59,7 +71,7 @@ android {
versionNameSuffix "-beta.1"
versionCode versionCodeDate()
buildConfigField 'String', 'BASE_SOFTWARE_NAME', '"ooniprobe-android-dev"'
resValue "string", "APP_ID", 'org.openobservatory.ooniprobe.dev'
resValue "string", "APP_ID", "${applicationId}.dev"
resValue "string", "APP_NAME", "OONI Dev"
buildConfigField 'String', 'COUNTLY_KEY', '"e6c2cfe53e85951d50567467cef3f9fa2eab32c3"'
}
Expand All @@ -69,7 +81,7 @@ android {
versionNameSuffix "-experimental.1"
versionCode versionCodeDate()
buildConfigField 'String', 'BASE_SOFTWARE_NAME', '"ooniprobe-android-experimental"'
resValue "string", "APP_ID", 'org.openobservatory.ooniprobe.experimental'
resValue "string", "APP_ID", "${applicationId}.experimental"
resValue "string", "APP_NAME", "OONI Exp"
buildConfigField 'String', 'COUNTLY_KEY', '"e6c2cfe53e85951d50567467cef3f9fa2eab32c3"'
}
Expand All @@ -79,16 +91,6 @@ android {
full {
dimension 'license'
}
dw {
dimension 'testing'
applicationId 'com.dw.ooniprobe'
resValue "string", "APP_ID", 'com.dw.ooniprobe'
resValue "string", "APP_NAME", "News Media Scan"
buildConfigField 'String', 'BASE_SOFTWARE_NAME', '"news-media-scan-android"'
buildConfigField "boolean", "SHOW_DISABLED_CARDS", "false"
//versionName '0.0.1'
//versionCode 1
}
}
variantFilter { variant ->
def names = variant.flavors*.name
Expand Down Expand Up @@ -192,3 +194,12 @@ if (!getGradle().getStartParameter().getTaskRequests()
.toString().contains("Fdroid")){
apply plugin: 'com.google.gms.google-services'
}

preBuild.doFirst {
// copy resources to right folders here
/*android.applicationVariants.all { variant ->
variant.productFlavors.each { flavor ->
println "Flavor: ${flavor.name}"
}
}*/
}
56 changes: 56 additions & 0 deletions app/src/dw/dev/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"project_info": {
"project_number": "951667061699",
"firebase_url": "https://ooniprobe-android.firebaseio.com",
"project_id": "ooniprobe-android",
"storage_bucket": "ooniprobe-android.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:951667061699:android:6293922d7e8d4180374376",
"android_client_info": {
"package_name": "com.dw.ooniprobe.dev"
}
},
"oauth_client": [
{
"client_id": "951667061699-6ijvga26pl048jrqfnd33o60bqcn0g7c.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.dw.ooniprobe.dev",
"certificate_hash": "a8f4bc5bef49e43d386647bdffdad32c07a8d3b8"
}
},
{
"client_id": "951667061699-2aq9bnbot04qdjbed2bpnl9ee4ro0c39.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBsbX_pOQoqlyOOyZ6yf7CJf0lZZn6O1yg"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "951667061699-2aq9bnbot04qdjbed2bpnl9ee4ro0c39.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "951667061699-tuprsdjjv9eje6506lkvkski1p6v87lp.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "org.openobservatory.ooniprobe",
"app_store_id": "1199566366"
}
}
]
}
}
}
],
"configuration_version": "1"
}
56 changes: 56 additions & 0 deletions app/src/dw/experimental/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"project_info": {
"project_number": "951667061699",
"firebase_url": "https://ooniprobe-android.firebaseio.com",
"project_id": "ooniprobe-android",
"storage_bucket": "ooniprobe-android.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:951667061699:android:6293922d7e8d4180374376",
"android_client_info": {
"package_name": "com.dw.ooniprobe.experimental"
}
},
"oauth_client": [
{
"client_id": "951667061699-6ijvga26pl048jrqfnd33o60bqcn0g7c.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.dw.ooniprobe.experimental",
"certificate_hash": "a8f4bc5bef49e43d386647bdffdad32c07a8d3b8"
}
},
{
"client_id": "951667061699-2aq9bnbot04qdjbed2bpnl9ee4ro0c39.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBsbX_pOQoqlyOOyZ6yf7CJf0lZZn6O1yg"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "951667061699-2aq9bnbot04qdjbed2bpnl9ee4ro0c39.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "951667061699-tuprsdjjv9eje6506lkvkski1p6v87lp.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "org.openobservatory.ooniprobe",
"app_store_id": "1199566366"
}
}
]
}
}
}
],
"configuration_version": "1"
}
22 changes: 0 additions & 22 deletions app/src/dw/res/values-ar/strings.xml

This file was deleted.

22 changes: 0 additions & 22 deletions app/src/dw/res/values-ca/strings.xml

This file was deleted.

22 changes: 0 additions & 22 deletions app/src/dw/res/values-de/strings.xml

This file was deleted.

Loading

0 comments on commit 0660a6e

Please sign in to comment.