Commit af26e689 authored by Nick Alexander's avatar Nick Alexander
Browse files

Bug 1366644 - Part 3a: Update Android build-tools (25.0.3), Gradle (3.4.1),...

Bug 1366644 - Part 3a: Update Android build-tools (25.0.3), Gradle (3.4.1), Android-Gradle (2.3.3). r=maliu

The goal is to use a newer Android-Gradle build plugin version (2.3.3
is latest stable).  That requires a modern Gradle (anything 3.3+, but
3.4.1 is the default from my Android Studio), and also a newer
build-tools (25.0.3 is latest stable).

The locations of lint output changed, and we want to use the standard
output location because it's difficult to accommodate variant details
in custom names.  We change the location of findbugs output to follow
suit.

This requires either:

- fixing lint errors
- adding to the lint whitelist
- using the new lint baseline

It's best to use the new lint baseline, which will happen in the next commit.

MozReview-Commit-ID: D19FzIDCJrE

--HG--
extra : rebase_source : 12d132c0c3e0dbe2b8873b31360ea96d612de44c
parent ec1556ae
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ buildscript {
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.3'
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath('com.stanfy.spoon:spoon-gradle-plugin:1.0.4') {
            // Without these, we get errors linting.
            exclude module: 'guava'
+2 −2
Original line number Diff line number Diff line
@@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionSha256Sum=88a910cdf2e03ebbb5fe90f7ecf534fc9ac22e12112dc9a2fee810c598a76091
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip
distributionSha256Sum=ed7e9c8bb41bd10d4c9339c95b2f8b122f5bf13188bd90504a26e0f00b123b0d
+2 −2
Original line number Diff line number Diff line
@@ -486,7 +486,7 @@ android.applicationVariants.all { variant ->

        reports {
            html.enabled = true // HTML reports for humans.
            html.destination = "$project.buildDir/outputs/findbugs/findbugs-${variant.name}-output.html"
            html.destination = "$project.buildDir/reports/findbugs/findbugs-${variant.name}-output.html"
            xml.enabled = false
        }
    }
@@ -510,7 +510,7 @@ android.applicationVariants.all { variant ->

        reports {
            xml.enabled = true // XML reports for machines.
            xml.destination = "$project.buildDir/outputs/findbugs/findbugs-${variant.name}-output.xml"
            xml.destination = "$project.buildDir/reports/findbugs/findbugs-${variant.name}-output.xml"
            html.enabled = false
        }
    }
+5 −5
Original line number Diff line number Diff line
@@ -135,11 +135,11 @@ class MachCommands(MachCommandBase):
        if 'TASK_ID' in os.environ and 'RUN_ID' in os.environ:
            root_url = "https://queue.taskcluster.net/v1/task/{}/runs/{}/artifacts/public/android/lint".format(os.environ['TASK_ID'], os.environ['RUN_ID'])
        else:
            root_url = os.path.join(self.topobjdir, 'gradle/build/mobile/android/app/outputs')
            root_url = os.path.join(self.topobjdir, 'gradle/build/mobile/android/app/reports')

        reports = ('officialPhotonDebug',)
        for report in reports:
            f = open(os.path.join(self.topobjdir, 'gradle/build/mobile/android/app/outputs/lint-results-{}.xml'.format(report)), 'rt')
            f = open(os.path.join(self.topobjdir, 'gradle/build/mobile/android/app/reports/lint-results-{}.xml'.format(report)), 'rt')
            tree = ET.parse(f)
            root = tree.getroot()

@@ -230,12 +230,12 @@ class MachCommands(MachCommandBase):
        if 'TASK_ID' in os.environ and 'RUN_ID' in os.environ:
            root_url = "https://queue.taskcluster.net/v1/task/{}/runs/{}/artifacts/public/artifacts/findbugs".format(os.environ['TASK_ID'], os.environ['RUN_ID'])
        else:
            root_url = os.path.join(self.topobjdir, 'gradle/build/mobile/android/app/outputs/findbugs')
            root_url = os.path.join(self.topobjdir, 'gradle/build/mobile/android/app/reports/findbugs')

        reports = ('findbugs-officialPhotonDebug-output.xml',)
        for report in reports:
            try:
                f = open(os.path.join(self.topobjdir, 'gradle/build/mobile/android/app/outputs/findbugs', report), 'rt')
                f = open(os.path.join(self.topobjdir, 'gradle/build/mobile/android/app/reports/findbugs', report), 'rt')
            except IOError:
                continue

@@ -316,7 +316,7 @@ class MachCommands(MachCommandBase):
        # Android tools expect UTF-8: see
        # http://tools.android.com/knownissues/encoding.  See
        # http://stackoverflow.com/a/21267635 for discussion of this approach.
        return self.run_process([self.substs['GRADLE']] + gradle_flags + args,
        return self.run_process([self.substs['GRADLE']] + gradle_flags + ['--console=plain'] + args,
            append_env={
                'GRADLE_OPTS': '-Dfile.encoding=utf-8',
                'JAVA_HOME': java_home,
+1 −1
Original line number Diff line number Diff line
@@ -2220,7 +2220,7 @@ dnl ========================================================

case "$MOZ_BUILD_APP" in
mobile/android)
    MOZ_ANDROID_SDK(23, 23, 23.0.3 23.0.1, 26.0.0 26.0.0-dev 25.3.2 25.3.1)
    MOZ_ANDROID_SDK(23, 23, 25.0.3, 26.0.0 26.0.0-dev 25.3.2 25.3.1)
    ;;
esac

Loading