Commit 387c92a4 authored by Alex Catarineu's avatar Alex Catarineu Committed by Matthew Finkel
Browse files

Bug 40123: Allow building the instrumented tests apks for variants other than debug

This allows to specify the variant of the instrumented tests via
a `testBuildType` gradle argument. It also applies a workaround for
a R8 issue from https://issuetracker.google.com/issues/140851070.
parent edffcdc1
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -17,7 +17,16 @@ import org.gradle.internal.logging.text.StyledTextOutputFactory

import static org.gradle.api.tasks.testing.TestResult.ResultType

def obtainTestBuildType() {
    def result = "debug";
    if (project.hasProperty("testBuildType")) {
        result = project.getProperties().get("testBuildType")
    }
    result
}

android {
    testBuildType obtainTestBuildType()
    compileSdkVersion Config.compileSdkVersion

    if (project.hasProperty("testBuildType")) {
+4 −1
Original line number Diff line number Diff line
@@ -120,3 +120,6 @@
# Keep Android Lifecycle methods
# https://bugzilla.mozilla.org/show_bug.cgi?id=1596302
-keep class androidx.lifecycle.** { *; }

# Workaround for 'already has mapping' r8 issue (https://issuetracker.google.com/issues/140851070)
-keep class com.google.android.gms.common.internal.BaseGmsClient { *; }
 No newline at end of file