summaryrefslogtreecommitdiff
path: root/java/lint.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2024-01-05 12:51:25 -0800
committer Colin Cross <ccross@android.com> 2024-01-05 21:09:20 +0000
commitb9176417ebd4c38a81f3fb2e28cc35a82764d037 (patch)
tree791231d882caf0e679661d14a75c8038ac6bfc64 /java/lint.go
parentcf132236e744e19a0e55338c24e7ba6fc4569d4d (diff)
Add per-module phony targets for lint checks
Simplify running lint on a module by adding a per-module phony target, e.g. Gallery2-lint. Bug: 216462289 Test: m Gallery2-lint Change-Id: I9d4ab362bb116d49f00fc3f79d61d7239528d575
Diffstat (limited to 'java/lint.go')
-rw-r--r--java/lint.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/java/lint.go b/java/lint.go
index e740c3aaf..c3d723b40 100644
--- a/java/lint.go
+++ b/java/lint.go
@@ -542,6 +542,10 @@ func (l *linter) lint(ctx android.ModuleContext) {
if l.buildModuleReportZip {
l.reports = BuildModuleLintReportZips(ctx, l.LintDepSets())
}
+
+ // Create a per-module phony target to run the lint check.
+ phonyName := ctx.ModuleName() + "-lint"
+ ctx.Phony(phonyName, xml)
}
func BuildModuleLintReportZips(ctx android.ModuleContext, depSets LintDepSets) android.Paths {