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
This commit is contained in:
@@ -57,6 +57,15 @@ var (
|
||||
},
|
||||
"cpFlags")
|
||||
|
||||
// A copy rule that only updates the output if it changed.
|
||||
CpIfChanged = pctx.AndroidStaticRule("CpIfChanged",
|
||||
blueprint.RuleParams{
|
||||
Command: "if ! cmp -s $in $out; then cp $in $out; fi",
|
||||
Description: "cp if changed $out",
|
||||
Restat: true,
|
||||
},
|
||||
"cpFlags")
|
||||
|
||||
CpExecutable = pctx.AndroidStaticRule("CpExecutable",
|
||||
blueprint.RuleParams{
|
||||
Command: "rm -f $out && cp $cpPreserveSymlinks $cpFlags $in $out && chmod +x $out",
|
||||
|
10
java/lint.go
10
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),
|
||||
})
|
||||
|
Reference in New Issue
Block a user