Skip to content

Commit

Permalink
Use a distinct application ID and app name for debug builds
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
  • Loading branch information
chenxiaolong committed Mar 31, 2023
1 parent 582e216 commit 4c31998
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
13 changes: 12 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ android {

buildConfigField("String", "DOCUMENTS_AUTHORITY",
"APPLICATION_ID + \".documents\"")
resValue("string", "documents_authority", "$applicationId.documents")

resValue("string", "app_name", "@string/app_name_release")
}
sourceSets {
getByName("main") {
Expand All @@ -145,6 +146,12 @@ android {
}
}
buildTypes {
getByName("debug") {
applicationIdSuffix = ".debug"

resValue("string", "app_name", "@string/app_name_debug")
}

getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
Expand All @@ -153,6 +160,10 @@ android {
signingConfig = signingConfigs.getByName("release")
}
}
applicationVariants.all {
// This is set here so that applicationIdSuffix will be respected
resValue("string", "documents_authority", "$applicationId.documents")
}
compileOptions {
sourceCompatibility(JavaVersion.VERSION_11)
targetCompatibility(JavaVersion.VERSION_11)
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<resources>
<string name="app_name">RSAF</string>
<string name="app_name_release">RSAF</string>
<string name="app_name_debug">RSAF (Debug)</string>

<!-- Preference headers -->
<string name="pref_header_remotes">Remotes</string>
Expand Down

0 comments on commit 4c31998

Please sign in to comment.