From the Android Tools Project Site's Android Gradle Plugin User Guide I'm aware that it's possible to prevent Android's lint from aborting a build using:
lintOptions { abortOnError false }
I'm also aware that lint can be disabled for release builds:
lintOptions { checkReleaseBuilds false }
However, is it possible to completely disable lint when running e.g. gradle assembleDebug
?
I'm aware of the risks and for this particular project it is wasting a fair amount of time given all the build flavors we have.
Queries related to “disable lint”Use // eslint-disable-next-line to ignore the next line. You may use special comments to disable some warnings. Use // eslint-disable-next-line to ignore the next line. Use /* eslint-disable */ to ignore all warnings in a file.
Android Studio provides a code scanning tool called lint that can help you to identify and correct problems with the structural quality of your code without having to execute the app or write test cases.
The com.android.lint plugin is the “standalone” lint Gradle plugin which can be applied to any Kotlin or Java Gradle project. To configure this project, use a lint block to configure it, like this: apply plugin: 'kotlin' apply plugin: 'com.android.lint' lint { htmlOutput = file("lint-report.html") textReport = true }
In many cases, lint warns you about incorrect, error-prone, or nonstandard code that the compiler does not necessarily flag. The lint program issues every error and warning message produced by the C compiler. It also issues warnings about potential bugs and portability problems.
Surely you can do this by adding this line in your gradle.properties
file:
gradle=build -x lint -x lintVitalRelease
Warning: The above line will prevent running lint for both debug and release builds!
If you want to find out more gradle hacks, speedy builds, performance improvements, this will be the best slides you'll be looking at: Mastering Gradle 3.0
I prepared this from a lot of different resources including Android Developer & Gradle documentation, Android Developer videos, etc - hope it helps! It really makes a huge difference in build times (incremental as well as project load time)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With