Bazel: Feature Request: Android Lint Tool Integration

Created on 20 Jul 2018  路  7Comments  路  Source: bazelbuild/bazel

Description of the feature request:

Support for the Android Lint tool. This could be accomplished as a separate rule to perform the analysis on an android_library, android_binary, etc.

What underlying problem are you trying to solve with this feature?

Android projects built with Bazel would benefit from running the Android Lint tool to ensure code quality. Currently, it appears that this is only possible by using the tool directly or via another build system. Having this ability built into Bazel would simplify the process.

Have you found anything relevant by searching the web?

I found nothing and filed this to get more info if something for this already exists.

P2 team-Android feature request

Most helpful comment

I've ported Android Lint to Buck recently, giving it a try with Bazel now.

Btw, we shouldn't tie Android Lint to android_library and android_binary rules, Android Lint runs absolutely fine on Java/Kotlin/resource targets too!

All 7 comments

@jin or anyone else on the Android team, wanted to check in and see if there has been any progress made on this or if we should be expecting anything relatively soon. My team at Square is looking to adopt Bazel and it would be a huge selling point if Android Lint with Bazel had decent performance as it is currently unusable with Gradle on our project.

Unfortunately, there's currently nobody working on Lint integration with Bazel, as the main efforts are on publishing the Android Starlark rules and the refreshed rulesets to rules_android.

cc @ahumesky

I've ported Android Lint to Buck recently, giving it a try with Bazel now.

Btw, we shouldn't tie Android Lint to android_library and android_binary rules, Android Lint runs absolutely fine on Java/Kotlin/resource targets too!

@artem-zinnatullin do you have any updates on your work. I'm curious if you could share your code.

Related - there exists a lintPublish configuration in the android gradle plugin that's used to indicate a local lint check that should be packaged into the aar. This, as far as I can tell, just makes one large lint.jar that's packaged in the aar. It would be good if android_library could support this as well

I just took a really, really quick look at https://android.googlesource.com/platform/tools/base/+/studio-master-dev/bazel/lint.bzl and it looks like it might be possible to extract what has been done in this repo and re-use it. Did anyone try that?

Me and @artem-zinnatullin have plans to create a rule as part of the @buildfoundation, seems like at least running Lint checks can be achieved.

Was this page helpful?
0 / 5 - 0 ratings