summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2021-03-05 23:34:14 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2021-03-05 23:34:14 +0000
commit3903d401d0c16fa90a36b180db3d99de2294b48c (patch)
treebe6b0f8c5398120f1f12d07850f8004af55ecd49 /java
parent083e6cd267698f5257f4a71ee8ab9470886d234a (diff)
parent5c113d13eb64f40e5d0d4212ca112cacc7979756 (diff)
Merge changes from topic "lint_repackage"
* changes: Remove lint outputs to prevent showing old lint results on error Make common dependencies of lint use restat Use repackaged lint binary
Diffstat (limited to 'java')
-rw-r--r--java/lint.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/java/lint.go b/java/lint.go
index 827259573..50b84dc71 100644
--- a/java/lint.go
+++ b/java/lint.go
@@ -313,6 +313,7 @@ func (l *linter) lint(ctx android.ModuleContext) {
rule.Command().Text("rm -rf").Flag(cacheDir.String()).Flag(homeDir.String())
rule.Command().Text("mkdir -p").Flag(cacheDir.String()).Flag(homeDir.String())
+ rule.Command().Text("rm -f").Output(html).Output(text).Output(xml)
var annotationsZipPath, apiVersionsXMLPath android.Path
if ctx.Config().AlwaysUsePrebuiltSdks() {
@@ -329,8 +330,7 @@ func (l *linter) lint(ctx android.ModuleContext) {
FlagWithArg("ANDROID_SDK_HOME=", homeDir.String()).
FlagWithInput("SDK_ANNOTATIONS=", annotationsZipPath).
FlagWithInput("LINT_OPTS=-DLINT_API_DATABASE=", apiVersionsXMLPath).
- Tool(android.PathForSource(ctx, "prebuilts/cmdline-tools/tools/bin/lint")).
- Implicit(android.PathForSource(ctx, "prebuilts/cmdline-tools/tools/lib/lint-classpath.jar")).
+ BuiltTool("lint").
Flag("--quiet").
FlagWithInput("--project ", projectXML).
FlagWithInput("--config ", lintXML).
@@ -362,7 +362,7 @@ func (l *linter) lint(ctx android.ModuleContext) {
}
}
- cmd.Text("|| (").Text("cat").Input(text).Text("; exit 7)").Text(")")
+ cmd.Text("|| (").Text("if [ -e").Input(text).Text("]; then cat").Input(text).Text("; fi; exit 7)").Text(")")
rule.Command().Text("rm -rf").Flag(cacheDir.String()).Flag(homeDir.String())
@@ -438,13 +438,13 @@ func (l *lintSingleton) copyLintDependencies(ctx android.SingletonContext) {
}
ctx.Build(pctx, android.BuildParams{
- Rule: android.Cp,
+ Rule: android.CpIfChanged,
Input: android.OutputFileForModule(ctx, frameworkDocStubs, ".annotations.zip"),
Output: copiedAnnotationsZipPath(ctx),
})
ctx.Build(pctx, android.BuildParams{
- Rule: android.Cp,
+ Rule: android.CpIfChanged,
Input: android.OutputFileForModule(ctx, frameworkDocStubs, ".api_versions.xml"),
Output: copiedAPIVersionsXmlPath(ctx),
})