avoid clashing buildconfig and moving placeholders to the modules which uses them

This commit is contained in:
Adam Brown 2022-08-02 18:06:43 +01:00
parent 2e81056b1e
commit ddaaa1aaeb
5 changed files with 12 additions and 10 deletions

View File

@ -234,8 +234,6 @@ android {
buildTypes { buildTypes {
debug { debug {
applicationIdSuffix ".debug" applicationIdSuffix ".debug"
resValue "string", "app_name", "Element dbg"
signingConfig signingConfigs.debug signingConfig signingConfigs.debug
if (project.hasProperty("coverage")) { if (project.hasProperty("coverage")) {
@ -244,7 +242,6 @@ android {
} }
release { release {
resValue "string", "app_name", "Element"
postprocessing { postprocessing {
removeUnusedCode true removeUnusedCode true
removeUnusedResources true removeUnusedResources true
@ -261,9 +258,6 @@ android {
applicationIdSuffix ".nightly" applicationIdSuffix ".nightly"
versionNameSuffix "-nightly" versionNameSuffix "-nightly"
// Just override the background color of the launcher icon for the nightly build.
resValue "color", "launcher_background", "#07007E"
// We need to copy paste this block, this is not done automatically by `initWith release` // We need to copy paste this block, this is not done automatically by `initWith release`
postprocessing { postprocessing {
removeUnusedCode true removeUnusedCode true

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="im.vector.app">
<application> <application>

View File

@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest package="im.vector.app"/> <manifest package="im.vector.application"/>

View File

@ -28,7 +28,7 @@ import dagger.Module
import dagger.Provides import dagger.Provides
import dagger.hilt.InstallIn import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent import dagger.hilt.components.SingletonComponent
import im.vector.app.BuildConfig import im.vector.application.BuildConfig
import im.vector.app.EmojiCompatWrapper import im.vector.app.EmojiCompatWrapper
import im.vector.app.EmojiSpanify import im.vector.app.EmojiSpanify
import im.vector.app.SpaceStateHandler import im.vector.app.SpaceStateHandler

View File

@ -13,6 +13,11 @@ kapt {
correctErrorTypes = true correctErrorTypes = true
} }
static def gitRevision() {
def cmd = "git rev-parse --short=8 HEAD"
return cmd.execute().text.trim()
}
project.android.buildTypes.all { buildType -> project.android.buildTypes.all { buildType ->
buildType.javaCompileOptions.annotationProcessorOptions.arguments = buildType.javaCompileOptions.annotationProcessorOptions.arguments =
[ [
@ -39,6 +44,8 @@ android {
abiFilters "armeabi-v7a", "x86", 'arm64-v8a', 'x86_64' abiFilters "armeabi-v7a", "x86", 'arm64-v8a', 'x86_64'
} }
// Generate a random app task affinity
manifestPlaceholders = [appTaskAffinitySuffix: "H_${gitRevision()}"]
// The following argument makes the Android Test Orchestrator run its // The following argument makes the Android Test Orchestrator run its
// "pm clear" command after each test invocation. This command ensures // "pm clear" command after each test invocation. This command ensures
@ -64,6 +71,8 @@ android {
} }
nightly { nightly {
initWith release initWith release
// Just override the background color of the launcher icon for the nightly build.
resValue "color", "launcher_background", "#07007E"
} }
release { release {
resValue "string", "app_name", "Element" resValue "string", "app_name", "Element"