diff --git a/changelog.d/5668.misc b/changelog.d/5668.misc new file mode 100644 index 00000000000..220a9027efc --- /dev/null +++ b/changelog.d/5668.misc @@ -0,0 +1 @@ +Improving build speed after committing or changing branches by removing git sha information from debug builds diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index 25cfaeb45ee..3eed4d823c4 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -33,10 +33,6 @@ android { buildConfigField "String", "SDK_VERSION", "\"1.4.10\"" - buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\"" - buildConfigField "String", "GIT_SDK_REVISION_UNIX_DATE", "\"${gitRevisionUnixDate()}\"" - buildConfigField "String", "GIT_SDK_REVISION_DATE", "\"${gitRevisionDate()}\"" - defaultConfig { consumerProguardFiles 'proguard-rules.pro' } @@ -53,11 +49,19 @@ android { buildConfigField "boolean", "LOG_PRIVATE_DATA", project.property("vector.debugPrivateData") // Set to BODY instead of NONE to enable logging buildConfigField "okhttp3.logging.HttpLoggingInterceptor.Level", "OKHTTP_LOGGING_LEVEL", "okhttp3.logging.HttpLoggingInterceptor.Level." + project.property("vector.httpLogLevel") + + buildConfigField "String", "GIT_SDK_REVISION", "\"dev\"" + buildConfigField "String", "GIT_SDK_REVISION_UNIX_DATE", "\"dev\"" + buildConfigField "String", "GIT_SDK_REVISION_DATE", "\"dev\"" } release { buildConfigField "boolean", "LOG_PRIVATE_DATA", "false" buildConfigField "okhttp3.logging.HttpLoggingInterceptor.Level", "OKHTTP_LOGGING_LEVEL", "okhttp3.logging.HttpLoggingInterceptor.Level.BASIC" + + buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\"" + buildConfigField "String", "GIT_SDK_REVISION_UNIX_DATE", "\"${gitRevisionUnixDate()}\"" + buildConfigField "String", "GIT_SDK_REVISION_DATE", "\"${gitRevisionDate()}\"" } } diff --git a/vector/build.gradle b/vector/build.gradle index f5984ff0c61..6d2a14edc1b 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -131,14 +131,6 @@ android { // Required for sonar analysis versionName "${versionMajor}.${versionMinor}.${versionPatch}-sonar" - // Generate a random app task affinity - manifestPlaceholders = [appTaskAffinitySuffix:"H_${gitRevision()}"] - - buildConfigField "String", "GIT_REVISION", "\"${gitRevision()}\"" - buildConfigField "String", "GIT_REVISION_DATE", "\"${gitRevisionDate()}\"" - buildConfigField "String", "GIT_BRANCH_NAME", "\"${gitBranchName()}\"" - buildConfigField "String", "BUILD_NUMBER", "\"${buildNumber}\"" - buildConfigField "im.vector.app.features.VectorFeatures.OnboardingVariant", "ONBOARDING_VARIANT", "im.vector.app.features.VectorFeatures.OnboardingVariant.FTUE_AUTH" buildConfigField "im.vector.app.features.crypto.keysrequest.OutboundSessionKeySharingStrategy", "outboundSessionKeySharingStrategy", "im.vector.app.features.crypto.keysrequest.OutboundSessionKeySharingStrategy.WhenTyping" @@ -232,6 +224,13 @@ android { buildConfigField "boolean", "ENABLE_STRICT_MODE_LOGS", "false" buildConfigField "Boolean", "ENABLE_LIVE_LOCATION_SHARING", "true" + // using static values to avoid cache misses on new commits + manifestPlaceholders = [appTaskAffinitySuffix: "H_aaaaaa"] + buildConfigField "String", "GIT_REVISION", "\"dev\"" + buildConfigField "String", "GIT_REVISION_DATE", "\"dev\"" + buildConfigField "String", "GIT_BRANCH_NAME", "\"dev\"" + buildConfigField "String", "BUILD_NUMBER", "\"dev\"" + signingConfig signingConfigs.debug } @@ -242,6 +241,13 @@ android { buildConfigField "boolean", "ENABLE_STRICT_MODE_LOGS", "false" buildConfigField "Boolean", "ENABLE_LIVE_LOCATION_SHARING", "false" + manifestPlaceholders = [appTaskAffinitySuffix:"H_${gitRevision()}"] + + buildConfigField "String", "GIT_REVISION", "\"${gitRevision()}\"" + buildConfigField "String", "GIT_REVISION_DATE", "\"${gitRevisionDate()}\"" + buildConfigField "String", "GIT_BRANCH_NAME", "\"${gitBranchName()}\"" + buildConfigField "String", "BUILD_NUMBER", "\"${buildNumber}\"" + postprocessing { removeUnusedCode true removeUnusedResources true