Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Globally set lintOptions in android studio gradle file

How should I set Lint Option and VersionCode/Name globally for all modules I have 3 module and 1 application module for every module/build.gradle file I need to set as

lintOptions {
        checkReleaseBuilds false
        abortOnError false
}  

But I want to set this in project level e.g in /build.gradle I have try to paste above code in upper level gradle file but not work

allprojects {

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
} 

Is there any way to set this globally ?

like image 938
sushant gosavi Avatar asked Jul 17 '18 14:07

sushant gosavi


1 Answers

Create a new Gradle script file, e.g. android-lint.gradle with the following contents:

android {
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
}

And then add this line below apply plugin: 'com.android.library' (or com.android.application) to every module:

apply from: '../android-lint.gradle'
like image 71
italankin Avatar answered Oct 07 '22 17:10

italankin