Skip to content

Commit

Permalink
Added a shared key for debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
spacecowboy committed Aug 9, 2023
1 parent 72782af commit e456f24
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ android {
javaCompileOptions {
annotationProcessorOptions {
compilerArgumentProviders(
RoomSchemaArgProvider(File(projectDir, "schemas"))
RoomSchemaArgProvider(File(projectDir, "schemas")),
)
argument("room.incremental", "true")
}
Expand All @@ -53,12 +53,25 @@ android {
}
}

if (project.hasProperty("STORE_FILE")) {
signingConfigs {
signingConfigs {
create("shareddebug") {
storeFile = rootProject.file("shareddebug.keystore")
storePassword = "android"
keyAlias = "AndroidDebugKey"
keyPassword = "android"
}
if (project.hasProperty("STORE_FILE")) {
create("release") {
@Suppress("LocalVariableName")
val STORE_FILE: String by project.properties

@Suppress("LocalVariableName")
val STORE_PASSWORD: String by project.properties

@Suppress("LocalVariableName")
val KEY_ALIAS: String by project.properties

@Suppress("LocalVariableName")
val KEY_PASSWORD: String by project.properties
storeFile = file(STORE_FILE)
storePassword = STORE_PASSWORD
Expand All @@ -76,25 +89,22 @@ android {
isPseudoLocalesEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
"proguard-rules.pro",
)
signingConfig = signingConfigs.getByName("shareddebug")
}
val debugMini by creating {
initWith(debug)
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
matchingFallbacks.add("debug")
}
val release by getting {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
"proguard-rules.pro",
)
if (project.hasProperty("STORE_FILE")) {
signingConfig = signingConfigs.getByName("release")
Expand All @@ -109,7 +119,7 @@ android {
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
"proguard-rules.pro",
)
if (project.hasProperty("STORE_FILE")) {
signingConfig = signingConfigs.getByName("release")
Expand Down Expand Up @@ -159,7 +169,7 @@ android {
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}
packagingOptions {
packaging {
resources {
excludes.addAll(
listOf(
Expand All @@ -174,8 +184,8 @@ android {
"META-INF/notice.txt",
"META-INF/ASL2.0",
"META-INF/AL2.0",
"META-INF/LGPL2.1"
)
"META-INF/LGPL2.1",
),
)
}
}
Expand Down Expand Up @@ -362,7 +372,7 @@ tasks {
file.name.startsWith("values")
}?.map { file ->
file.resolve("strings.xml")
} ?: error("Could not resolve values folders!")
} ?: error("Could not resolve values folders!"),
)

val localesConfigFile = file(projectDir.resolve("src/main/res/xml/locales_config.xml"))
Expand Down
Binary file added shareddebug.keystore
Binary file not shown.

0 comments on commit e456f24

Please sign in to comment.