Hi lint developers,
currently I've been
trying to implement a custom lint rule. Unfortunately I haven't been
able to get it run on Test sources (located at src/test). Since our
Android Project is large and have lots of gradle "oddities" I've tried
moving my custom lint rule to a new Project. Unfortunately, I've got no
success there either.
From looking at threads
[1] [2] in the lint-dev forum, it should work, yet I was unable to make it work.
The Implementation of the issue contains
EnumSet.of(Scope.JAVA_FILE, Scope.TEST_SOURCES)
and to verify, that my Detector actually works I wrote few unit tests and they are passing. Running the gradle task:
./gradlew :app:lintDebug yields no errors, altought it shoulld. Here is
public repository, where you can check the files out. There is
app module and
lint-rules
module. First module contains 2 unit test (java and kotlin), which I
would expect the lint to report. The lint-rules module contains
IssueRegistry, Detector and respective unit tests.
There are some warnings about the lint registry from kotlin libs, but that shouldn't be a problem, right?
Custom lint rule jar /Users/pesek/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.4.31/6dd50665802f54ba9bc3f70ecb20227d1bc81323/kotlin-stdlib-common-1.4.31.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
I'm
not sure if the setup is not right or I missunderstood something about
the scopes. If you could look into it, that would be great.
Best regards,
Vojtech P.