I have a multi-module app which uses a plugin to handle common settings for modules. One of the things I configure are some lint options. So far this was my implementation:
class MyPlugin : Plugin<Project> {
override fun apply(project: Project) {
project.plugins.apply("kotlin-android")
val androidExtension = project.extensions.getByName("android")
if (androidExtension is BaseExtension) {
androidExtension.apply {
lintOptions {
isAbortOnError = false
//other settings
}
}
}
}
I am getting warnings about deprecation such as:
'isAbortOnError: Boolean' is deprecated. Overrides deprecated member in 'com.android.build.api.dsl.LintOptions'. Moved to lint.abortOnError
I would like to move to Lint as suggested, but BaseExtension does not have lint, only lintOptions. How to do it?
You can use this in
I'm using it with
AGP 8.1.0-alpha10, but it will be probably valid also in older AGP.BaseExtensionis now part of the internal API and just because of compatibility with older projects.You should now depend only on
com.android.tools.build:gradle-apiartifact instead ofcom.android.tools.build:gradleAt least in an ideal situation.