I'd like to configure the API database explicitly for the following reasons:
* Enable ApiDetector in Java projects.
* Guarantee the use of a consistent API database by checking it into the repo (since the platform tools it's distributed with are not versioned).
As far as I can tell, the only way to do this is to set the LINT_API_DATABASE environment variable or system property. I tried setting the systemProp.LINT_API_DATABASE in my root gradle.properties, but the relative path is not resolved correctly. The alternative is to go with something like this, which is.. not ideal:
tasks.withType<AndroidLintTask>().configureEach {
val lintApiDatabasePath = project.rootProject.layout.projectDirectory.file("config/lint/api-database.xml").asFile.absolutePath
doFirstAction {
System.setProperty("LINT_API_DATABASE", lintApiDatabasePath)
}
}
Is there better way to do this? Would it make sense to make this configurable through a file option for {{ApiDetector}} in {{lint.xml}}?
Thanks,
César