[android] Re-organize flavors in proper way

Follow up 331b030 "Use module project structure"

Signed-off-by: Roman Tsisyk <roman@tsisyk.com>
This commit is contained in:
Roman Tsisyk 2023-09-04 20:46:24 +03:00
parent bd1d9147b7
commit a6ede2b146
545 changed files with 76 additions and 88 deletions

View file

@ -4,8 +4,8 @@ on:
pull_request:
paths:
- .github/workflows/android-check-metadata.yaml # Run check on self change
- android/app/src/main/fdroid/**
- android/app/src/main/google/**
- android/app/src/fdroid/**
- android/app/src/google/**
- tools/python/check_store_metadata.py
jobs:

View file

@ -14,8 +14,8 @@ on:
- LICENSE
- NOTICE
- README.md
- android/app/src/main/fdroid/**
- android/app/src/main/google/**
- android/app/src/fdroid/**
- android/app/src/google/**
- iphone/**
- data/strings/**
- docs/**

View file

@ -3,8 +3,8 @@ on:
workflow_dispatch: # Manual trigger
env:
RELEASE_NOTES: android/app/src/main/google/play/release-notes/en-US/default.txt
FDROID_VERSION: android/app/src/main/fdroid/play/version.yaml
RELEASE_NOTES: android/app/src/google/play/release-notes/en-US/default.txt
FDROID_VERSION: android/app/src/fdroid/play/version.yaml
JAVA_HOME: /usr/lib/jvm/temurin-17-jdk-amd64 # Java 17 is required for Android Gradle 8 plugin
jobs:

View file

@ -27,3 +27,6 @@
/src/main/res/drawable-mdpi/uk_northern_ireland.png
/src/main/res/drawable-mdpi/uk_scotland.png
/src/main/res/drawable-mdpi/uk_wales.png
# ignore autogenerated metadata (see prepareGoogleReleaseListing in build.gradle)
/src/google/play/listings

View file

@ -1 +0,0 @@
../../../data/00_NotoNaskhArabic-Regular.ttf

View file

@ -1 +0,0 @@
../../../data/00_NotoSansThai-Regular.ttf

View file

@ -1 +0,0 @@
../../../data/00_NotoSerifDevanagari-Regular.ttf

View file

@ -1 +0,0 @@
../../../data/01_dejavusans.ttf

View file

@ -1 +0,0 @@
../../../data/02_droidsans-fallback.ttf

View file

@ -1 +0,0 @@
../../../data/03_jomolhari-id-a3d.ttf

View file

@ -1 +0,0 @@
../../../data/04_padauk.ttf

View file

@ -1 +0,0 @@
../../../data/05_khmeros.ttf

View file

@ -1 +0,0 @@
../../../data/06_code2000.ttf

View file

@ -1 +0,0 @@
../../../data/07_roboto_medium.ttf

View file

@ -1 +0,0 @@
../../../data/categories.txt

View file

@ -1 +0,0 @@
../../../data/categories_brands.txt

View file

@ -1 +0,0 @@
../../../data/categories_cuisines.txt

View file

@ -1 +0,0 @@
../../../data/classificator.txt

View file

@ -1 +0,0 @@
../../../data/colors.txt

View file

@ -1 +0,0 @@
../../../data/copyright.html

View file

@ -1 +0,0 @@
../../../data/countries-strings/

View file

@ -1 +0,0 @@
../../../data/countries.txt

View file

@ -1 +0,0 @@
../../../data/drules_proto_clear.bin

View file

@ -1 +0,0 @@
../../../data/drules_proto_dark.bin

View file

@ -1 +0,0 @@
../../../data/drules_proto_vehicle_clear.bin

View file

@ -1 +0,0 @@
../../../data/drules_proto_vehicle_dark.bin

View file

@ -1 +0,0 @@
../../../data/editor.config

View file

@ -1 +0,0 @@
../../../data/faq.html

View file

@ -1 +0,0 @@
../../../data/fonts_blacklist.txt

View file

@ -1 +0,0 @@
../../../data/fonts_whitelist.txt

View file

@ -1 +0,0 @@
../../../data/icudt73l.dat

View file

@ -1 +0,0 @@
../../../data/languages.txt

View file

@ -1 +0,0 @@
../../../data/opening_hours_how_to_edit.html

View file

@ -1 +0,0 @@
../../../data/packed_polygons.bin

View file

@ -1 +0,0 @@
../../../data/patterns.txt

View file

@ -1 +0,0 @@
../../../data/resources-6plus_clear

View file

@ -1 +0,0 @@
../../../data/resources-6plus_dark

View file

@ -1 +0,0 @@
../../../data/resources-default

View file

@ -1 +0,0 @@
../../../data/resources-hdpi_clear

View file

@ -1 +0,0 @@
../../../data/resources-hdpi_dark

View file

@ -1 +0,0 @@
../../../data/resources-mdpi_clear

View file

@ -1 +0,0 @@
../../../data/resources-mdpi_dark

View file

@ -1 +0,0 @@
../../../data/resources-xhdpi_clear

View file

@ -1 +0,0 @@
../../../data/resources-xhdpi_dark

View file

@ -1 +0,0 @@
../../../data/resources-xxhdpi_clear

View file

@ -1 +0,0 @@
../../../data/resources-xxhdpi_dark

View file

@ -1 +0,0 @@
../../../data/resources-xxxhdpi_clear

View file

@ -1 +0,0 @@
../../../data/resources-xxxhdpi_dark

View file

@ -1 +0,0 @@
../../../data/sound-strings

View file

@ -1 +0,0 @@
../../../data/transit_colors.txt

View file

@ -1 +0,0 @@
../../../data/types.txt

View file

@ -1 +0,0 @@
../../../data/unicode_blocks.txt

View file

@ -1 +0,0 @@
../../../data/vulkan_shaders

View file

@ -14,10 +14,14 @@ buildscript {
def isFdroid = taskName.contains('fdroid')
def isBeta = taskName.contains('beta')
// Enable Google Mobile Services for all flavors except fdroid.
def googleMobileServicesDefault = !isFdroid
// Add a parameter to force GMS.
ext.googleMobileServicesEnabled = project.hasProperty('gms') ?: googleMobileServicesDefault
//
// Please add symlinks to google/java/app/organicmaps/location for each new gms-enabled flavor below:
// ```
// mkdir -p src/$flavor/java/app/organicmaps/
// ln -sf ../../../../google/java/app/organicmaps/location src/$flavor/java/app/organicmaps/
// ls -la src/$flavor/java/app/organicmaps/location/GoogleFusedLocationProvider.java
// ```
ext.googleMobileServicesEnabled = taskName.contains('google') || taskName.contains('huawei') || taskName.contains('web')
// Enable Firebase for all beta flavors except fdroid only if google-services.json exists.
def googleFirebaseServicesDefault = isBeta && !isFdroid && file('google-services.json').exists()
@ -211,19 +215,7 @@ android {
setProperty("archivesBaseName", appName.replaceAll("\\s","") + "-" + defaultConfig.versionCode)
}
sourceSets.main {
// manifest.srcFile 'AndroidManifest.xml'
// res.srcDirs = ['res']
// java.srcDirs = ['src']
if (googleMobileServicesEnabled) {
java.srcDirs += 'src/flavors/gms-enabled'
} else {
java.srcDirs += 'src/flavors/gms-disabled'
}
assets.srcDirs = ['assets']
}
flavorDimensions 'default'
flavorDimensions += 'default'
productFlavors {
// 01 is a historical artefact, sorry.
@ -234,21 +226,18 @@ android {
versionName = android.defaultConfig.versionName + '-Google'
buildConfigField 'String', 'SUPPORT_MAIL', '"googleplay@organicmaps.app"'
buildConfigField 'String', 'REVIEW_URL', '"market://details?id=app.organicmaps"'
android.sourceSets.google.assets.srcDirs = ['flavors/world-enabled']
}
web {
dimension "default"
versionName = android.defaultConfig.versionName + '-Web'
buildConfigField 'String', 'SUPPORT_MAIL', '"apk@organicmaps.app"'
//android.sourceSets.web.assets.srcDirs = ['flavors/world-enabled']
}
fdroid {
dimension "default"
versionName = android.defaultConfig.versionName + '-FDroid'
buildConfigField 'String', 'SUPPORT_MAIL', '"fdroid@organicmaps.app"'
//android.sourceSets.fdroid.assets.srcDirs = ['flavors/world-enabled']
}
huawei {
@ -257,7 +246,6 @@ android {
versionCode = HUAWEI_VERSION_CODE_BASE + android.defaultConfig.versionCode
buildConfigField 'String', 'SUPPORT_MAIL', '"huawei@organicmaps.app"'
buildConfigField 'String', 'REVIEW_URL', '"appmarket://details?id=app.organicmaps"'
android.sourceSets.huawei.assets.srcDirs = ['flavors/world-enabled']
}
}
@ -436,8 +424,8 @@ task prepareGoogleReleaseListing {
final sourceFlavor = 'fdroid'
final targetFlavor = 'google'
doLast {
final sourceDir = new File("${projectDir}/src/main/$sourceFlavor/play/listings")
final targetDir = new File("${projectDir}/src/main/$targetFlavor/play/listings")
final sourceDir = new File("${projectDir}/src/$sourceFlavor/play/listings")
final targetDir = new File("${projectDir}/src/$targetFlavor/play/listings")
final sourceFiles = fileTree(dir: sourceDir,
include: "**/*.txt", exclude: "**/*-${targetFlavor}.txt")
sourceFiles.each { File sourceFile ->
@ -484,7 +472,7 @@ huaweiPublish {
'ta-IN': 'ta_IN',
'te-IN': 'te_IN',
]
def files = fileTree(dir: "$projectDir/src/main/fdroid/play/listings",
def files = fileTree(dir: "$projectDir/src/fdroid/play/listings",
include: '**/release-notes.txt')
files.each { File file ->
def path = file.getPath()

Some files were not shown because too many files have changed in this diff Show more