Custom lint checks not running with gradle plugin 3.0.0

420 views
Skip to first unread message

ryan...@pinterest.com

unread,
Aug 17, 2017, 8:11:38 PM8/17/17
to lint-dev
We have a handful of custom lint checks that we run on every build.

I'm working on moving the app to gradle plugin 3.0.0-beta2.  The app seems to be building fine with the exception that our custom lint checks no longer seem to work.

The lint dependencies we use to build our lint checks.

compile 'com.android.tools.lint:lint-api:25.3.2'
compile 'com.android.tools.lint:lint-checks:25.3.2'
testCompile 'junit:junit:4.12'
testCompile 'com.android.tools.lint:lint:25.3.2'
testCompile 'com.android.tools.lint:lint-tests:25.3.2'
testCompile 'com.android.tools:testutils:25.3.2'

We have a separate lint project.  We use that to build a lint.jar.  The lint.jar is included in our common module using the following

task copyLintJar(type: Copy) {
from "${project.rootDir}/other/projects/lint/build/libs/lint.jar"
into 'build/intermediates/lint'
}

 Previously on the 2.3.2 plugin this would work for us and our custom lints would be runnable with:
./gradlew lintProductionDebug
Now running that our custom lint issues do not seem to run. Is there anything we need to do to make these custom lint checks continue working with gradle plugin 3.0.0? Thanks!

-Ryan

Tor Norbye

unread,
Aug 23, 2017, 2:51:37 PM8/23/17
to lint-dev
This apparently broke in the Gradle plugin semi-recently; Xav is going to fix it ASAP. 

I think Cesar had found a workaround for the meantime; can you post that here?

-- Tor

Tor Norbye

unread,
Sep 12, 2017, 5:35:48 PM9/12/17
to lint-dev
This went into 3.0 as of beta 5. 

I've uploaded a fix to the sample project here; it's still just a pull request but you can see how to do it:
Reply all
Reply to author
Forward
0 new messages