Configure detectors to only run when the Lint client is Gradle but not Android Studio.
77 views
Skip to first unread message
kiran puppala
unread,
Sep 7, 2021, 10:06:06 AM9/7/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to lint-dev
Hi Tor, We want few detectors to run only when Gradle lint task is executed but should not run from Android Studio. We want to execute some detectors only when the Lint client is Gradle. I know we can do that by checking the client while writing detector logic using this method LintClient.isGradle().
We would like to know if there's a more robust way of doing this instead of making this check everywhere inside detectors. Can we exclude few detectors in the Issue Registry based on the Lint client?
Example:
class CustomIssueRegistry : IssueRegistry() { override val issues: List<Issue> get() = if (LintClient.isGradle) { gradleOnlyIssueList } else { studioOnlyIssueList } }