Bug 1253082 - Try it out. f?mcomella
MozReview-Commit-ID: HaWCv0JkREY
--- 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" />