I am applying the lint project as follows to a app module where there are issues but non of the issues are detected.
lintChecks project(':customlint')
ImportsIssueRegistry.kt
class ImportsIssueRegistry : IssueRegistry() {
override val issues: List<Issue>
get() = listOf(
SyntheticImportIssue.ISSUE,
AndroidLogImportIssue.ISSUE
)
override val api: Int
get() = CURRENT_API
}
customlint/build.gradle
apply plugin: 'java-library'
apply plugin: 'kotlin'
ext.lintVersion = '26.4.2'
dependencies {
//noinspection DifferentStdlibGradleVersion
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compileOnly "com.android.tools.lint:lint-api:$lintVersion"
compileOnly "com.android.tools.lint:lint-checks:$lintVersion"
testImplementation 'junit:junit:4.13-beta-3'
testImplementation "com.android.tools.lint:lint:$lintVersion"
testImplementation "com.android.tools.lint:lint-tests:$lintVersion"
testImplementation "com.android.tools:testutils:$lintVersion"
}
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
jar{
manifest{
attributes 'Lint-Registry-V2': '[package name].ImportsIssueRegistry'
}
}
What I tried?
- Checking the gradle version? I have the latest version (3.4.2)
- Tried changing:
Lint-Registry
toLint-Registry-V2
in customlint module - Also tried adding generated jar as following to the module's build.gradle :
lintChecks fileTree(dir: 'libs', include: ['customlint.jar'] )
Update:
Full code can be found here
Someone please help.