bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.31k stars 4.1k forks source link

Feature Request: Android Lint Tool Integration #5643

Open cwoodwar6 opened 6 years ago

cwoodwar6 commented 6 years ago

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.

phoenixuprising commented 5 years ago

@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.

jin commented 5 years ago

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

artem-zinnatullin commented 5 years ago

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!

tokudu commented 4 years ago

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

ZacSweers commented 4 years ago

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

Kernald commented 4 years ago

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?

arturdryomov commented 4 years ago

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.

Kernald commented 2 years ago

Did anyone make any progress on this?

Bencodes commented 2 years ago

We have a working solution that we've build internally for running Android Lint with Bazel, so it's possible (supports multiplexed workers).

It's also worth noting that there are some early rules checked into Bazel but the wrapper that drives most of the functionality hasn't been checked in. You can see parts of it here and here, and the missing tool that needs to be checked in would come from here.

github-actions[bot] commented 1 year ago

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

cpsauer commented 1 year ago

@bazelbuild/triage, this issue is definitely still relevant and interesting to me, at least, and I'd guess others.

@Bencodes, any chance you'd be willing to release the internal one?

(@bazelbuild/triage didn't seem to create a tag last I tried (no link) so I'm going to also tag @sgowroji and @Pavank1992 manually. Please coach me if you'd have preferred otherwise--and maybe update the bot's instructions)