Bug 1253082 - Try it out. f?mcomella draft
authorNick Alexander <nalexander@mozilla.com>
Wed, 02 Mar 2016 20:49:55 -0800
changeset 336422 971e55874b7bb82f30dec6faeb77d52ba2b518a9
parent 336157 82e8f730b3e18f3be117c5a202f9fead8e7a9e78
child 515390 49de33179ee1da2ff11e6f9246aea15f1e7625d5
push id12061
push usernalexander@mozilla.com
push dateThu, 03 Mar 2016 05:11:25 +0000
bugs1253082
milestone47.0a1
Bug 1253082 - Try it out. f?mcomella MozReview-Commit-ID: HaWCv0JkREY
mobile/android/app/build.gradle
mobile/android/app/lint.xml
--- a/mobile/android/app/build.gradle
+++ b/mobile/android/app/build.gradle
@@ -26,17 +26,17 @@ android {
         targetCompatibility JavaVersion.VERSION_1_7
     }
  
     dexOptions {
         javaMaxHeapSize "2g"
     }
 
     lintOptions {
-        abortOnError false
+        // abortOnError false
     }
 
     buildTypes {
         release {
             shrinkResources true
             minifyEnabled true
             proguardFile "${topsrcdir}/mobile/android/config/proguard/proguard.cfg"
         }
@@ -293,21 +293,31 @@ task buildOmnijar(type:Exec) {
 // Fennec, however, with applicationId.  To use the same manifest as moz.build,
 // we replace the package with org.mozilla.gecko (the eventual package) here.
 task rewriteManifestPackage(type: Copy, dependsOn: rootProject.generateCodeAndResources) {
     into("${project.buildDir}/generated/source/preprocessed_manifest")
     from("${topobjdir}/mobile/android/base/AndroidManifest.xml")
     filter { it.replaceFirst(/package=".*?"/, 'package="org.mozilla.gecko"') }
 }
 
+task finalizeLint << {
+    def lint = tasks.findByName("lintAutomationDebug")
+    if (lint.state.executed && lint.state.failure) {
+        println "[lint:error] Android lint failed"
+    }
+}
+
 android.applicationVariants.all { variant ->
     variant.preBuild.dependsOn rewriteManifestPackage
     variant.preBuild.dependsOn syncPreprocessedCode
     variant.preBuild.dependsOn syncPreprocessedResources
 
+    def lint = tasks.findByName("lintAutomationDebug")
+    lint.finalizedBy(finalizeLint)
+
     // Like 'local' or 'localOld'.
     def productFlavor = variant.productFlavors[0].name
     // Like 'debug' or 'release'.
     def buildType = variant.buildType.name
 
     // We insert omni.ja and the .so libraries into all local builds.
     if (!productFlavor.startsWith('local')) {
         return
--- a/mobile/android/app/lint.xml
+++ b/mobile/android/app/lint.xml
@@ -15,17 +15,17 @@
     <!-- We want all lint warnings to be fatal errors.
          Right now, we set these to lint warnings so:
 
          DO NOT ADD TO THIS LIST.
 
          We did this so we can land lint in automation
          and not fail everything. -->
     <issue id="AppCompatResource" severity="warning" />
-    <issue id="GoogleAppIndexingDeepLinkError" severity="warning" />
+    <issue id="GoogleAppIndexingDeepLinkError" severity="error" />
     <issue id="Instantiatable" severity="warning" />
     <issue id="LongLogTag" severity="warning" />
     <issue id="MissingPermission" severity="warning" />
     <issue id="MissingSuperCall" severity="warning" />
     <issue id="NewApi" severity="warning" />
     <issue id="OnClick" severity="warning" />
     <issue id="ReferenceType" severity="warning" />
     <issue id="ResourceAsColor" severity="warning" />