summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2020-06-23 10:25:26 -0700
committer Colin Cross <ccross@android.com> 2020-06-23 14:45:04 -0700
commit91edfc29c3fa54b8f55642724fc9e90397d225cc (patch)
tree521d0cd3c56535316181c52baf5ae63895c88843 /java
parentbca9028825d3130762e2b9cb6de4a8a7f85010b6 (diff)
Set root dir in lint project.xml
Set the root dir in the project.xml for lint so that the paths in the lint report are relative to the top of the tree instead of relative to the project.xml. Bug: 153485543 Test: run lint Change-Id: Ie163a4dadd976e708f798855de73e58084931a91 Merged-In: Ie163a4dadd976e708f798855de73e58084931a91 (cherry picked from commit c31efeb25cac61fd3c2af3fed5bedeca2d401994)
Diffstat (limited to 'java')
-rw-r--r--java/lint.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/java/lint.go b/java/lint.go
index ca87dbab6..b73d6a51a 100644
--- a/java/lint.go
+++ b/java/lint.go
@@ -155,8 +155,11 @@ func (l *linter) writeLintProjectXML(ctx android.ModuleContext,
cmd.FlagForEachArg("--extra_checks_jar ", l.extraLintCheckJars.Strings())
deps = append(deps, l.extraLintCheckJars...)
- // The cache tag in project.xml is relative to the project.xml file.
- cmd.FlagWithArg("--cache_dir ", "cache")
+ cmd.FlagWithArg("--root_dir ", "$PWD")
+
+ // The cache tag in project.xml is relative to the root dir, or the project.xml file if
+ // the root dir is not set.
+ cmd.FlagWithArg("--cache_dir ", cacheDir.String())
cmd.FlagWithInput("@",
android.PathForSource(ctx, "build/soong/java/lint_defaults.txt"))