set separate app ID & icon for debug version

This commit is contained in:
Franek 2024-06-16 11:38:47 +02:00
parent 9fbafd0eee
commit a4ac17143f
No known key found for this signature in database
GPG Key ID: 0329F871B2079351
9 changed files with 63 additions and 9 deletions

View File

@ -1,3 +1,5 @@
import android.annotation.SuppressLint
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
@ -20,8 +22,9 @@ android {
buildConfigField "java.util.Map<String, String>", "GIT_INFO", gitInfoMap buildConfigField "java.util.Map<String, String>", "GIT_INFO", gitInfoMap
buildConfigField "String", "VERSION_BASE", "\"${release.versionName}\"" buildConfigField "String", "VERSION_BASE", "\"${release.versionName}\""
manifestPlaceholders = [ manifestPlaceholders = [
buildTimestamp: String.valueOf(System.currentTimeMillis()) buildTimestamp: String.valueOf(System.currentTimeMillis())
] ]
multiDexEnabled = true multiDexEnabled = true
@ -36,8 +39,8 @@ android {
arguments { arguments {
arg("room.schemaLocation", "$projectDir/schemas") arg("room.schemaLocation", "$projectDir/schemas")
} }
correctErrorTypes true
correctErrorTypes true
} }
} }
@ -45,10 +48,12 @@ android {
debug { debug {
getIsDefault().set(true) getIsDefault().set(true)
minifyEnabled = false minifyEnabled = false
applicationIdSuffix ".debug"
manifestPlaceholders = [ manifestPlaceholders = [
buildTimestamp: 0 buildTimestamp: 0
] ]
} }
release { release {
minifyEnabled = true minifyEnabled = true
shrinkResources = true shrinkResources = true
@ -56,28 +61,35 @@ android {
proguardFiles fileTree('proguard').asList().toArray() proguardFiles fileTree('proguard').asList().toArray()
} }
} }
flavorDimensions "platform"
flavorDimensions += "platform"
productFlavors { productFlavors {
unofficial { unofficial {
getIsDefault().set(true) getIsDefault().set(true)
versionName "${release.versionName}-${gitInfo.versionSuffix}" versionName "${release.versionName}-${gitInfo.versionSuffix}"
} }
official {} official {}
play {} play {}
} }
variantFilter { variant -> variantFilter { variant ->
def flavors = variant.flavors*.name def flavors = variant.flavors*.name
setIgnore(variant.buildType.name == "debug" && !flavors.contains("unofficial") || flavors.contains("main")) setIgnore(variant.buildType.name == "debug" && !flavors.contains("unofficial") || flavors.contains("main"))
} }
sourceSets { sourceSets {
unofficial { unofficial {
java.srcDirs = ["src/main/java", "src/play-not/java"] java.srcDirs = ["src/main/java", "src/play-not/java"]
manifest.srcFile("src/play-not/AndroidManifest.xml") manifest.srcFile("src/play-not/AndroidManifest.xml")
} }
official { official {
java.srcDirs = ["src/main/java", "src/play-not/java"] java.srcDirs = ["src/main/java", "src/play-not/java"]
manifest.srcFile("src/play-not/AndroidManifest.xml") manifest.srcFile("src/play-not/AndroidManifest.xml")
} }
play { play {
java.srcDirs = ["src/main/java", "src/play/java"] java.srcDirs = ["src/main/java", "src/play/java"]
} }
@ -86,35 +98,41 @@ android {
defaultConfig { defaultConfig {
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
} }
buildFeatures { buildFeatures {
dataBinding = true dataBinding = true
viewBinding = true viewBinding = true
buildConfig true buildConfig = true
} }
compileOptions { compileOptions {
coreLibraryDesugaringEnabled = true coreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
} }
kotlinOptions { kotlinOptions {
jvmTarget = "1.8" jvmTarget = "1.8"
} }
packagingOptions { packagingOptions {
resources { resources {
excludes += ['META-INF/library-core_release.kotlin_module'] excludes += ['META-INF/library-core_release.kotlin_module']
} }
} }
externalNativeBuild { externalNativeBuild {
cmake { cmake {
path "src/main/cpp/CMakeLists.txt" path "src/main/cpp/CMakeLists.txt"
version "3.10.2" version "3.10.2"
} }
} }
lint { lint {
checkReleaseBuilds false checkReleaseBuilds false
} }
namespace 'pl.szczodrzynski.edziennik'
namespace 'pl.szczodrzynski.edziennik'
} }
tasks.whenTaskAdded { task -> tasks.whenTaskAdded { task ->

View File

@ -36,6 +36,37 @@
"status": 2 "status": 2
} }
} }
},
{
"client_info": {
"mobilesdk_app_id": "1:640759989760:android:4aa71407b25cdc8d",
"android_client_info": {
"package_name": "pl.szczodrzynski.edziennik.debug"
}
},
"oauth_client": [
{
"client_id": "640759989760-6f8q00u864lnuh3gh36e8g4cer9lv8pv.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAvq9HMPxulz9ntdAHZ0eZuPf2YQs4nDSU"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
} }
], ],
"configuration_version": "1" "configuration_version": "1"

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) Kuba Szczodrzyński 2020-5-11.
-->
<resources>
<color name="ic_launcher_background">#FF7D54</color>
</resources>

View File

@ -41,7 +41,6 @@
|___/ --> |___/ -->
<activity android:name=".MainActivity" <activity android:name=".MainActivity"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTop" android:launchMode="singleTop"
android:exported="true" android:exported="true"
android:theme="@style/SplashTheme"> android:theme="@style/SplashTheme">
@ -134,7 +133,6 @@
android:theme="@style/DeadTheme" /> android:theme="@style/DeadTheme" />
<activity android:name=".ui.intro.ChangelogIntroActivity" <activity android:name=".ui.intro.ChangelogIntroActivity"
android:configChanges="orientation|keyboardHidden" android:configChanges="orientation|keyboardHidden"
android:label="@string/app_name"
android:exported="false" android:exported="false"
android:theme="@style/Theme.Intro" /> android:theme="@style/Theme.Intro" />
<activity android:name=".ui.login.LoginActivity" <activity android:name=".ui.login.LoginActivity"
@ -147,7 +145,6 @@
android:theme="@style/AppTheme.Black" /> android:theme="@style/AppTheme.Black" />
<activity android:name=".ui.feedback.FeedbackActivity" <activity android:name=".ui.feedback.FeedbackActivity"
android:configChanges="orientation|screenSize|keyboardHidden" android:configChanges="orientation|screenSize|keyboardHidden"
android:label="@string/app_name"
android:exported="false" android:exported="false"
android:theme="@style/AppTheme" /> android:theme="@style/AppTheme" />
<activity android:name=".ui.settings.SettingsLicenseActivity" <activity android:name=".ui.settings.SettingsLicenseActivity"