Make common dependencies of lint use restat
Use restat for the api_versions.xml and annotations.zip dependencies of lint so that frameworks/base changes don't always result in rerunning lint on every module. Bug: 181681346 Test: m lint-check Change-Id: Ic6a540b41cf79b21441311a8baefe528a3d90d8b
This commit is contained in:
@@ -57,6 +57,15 @@ var (
|
|||||||
},
|
},
|
||||||
"cpFlags")
|
"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",
|
CpExecutable = pctx.AndroidStaticRule("CpExecutable",
|
||||||
blueprint.RuleParams{
|
blueprint.RuleParams{
|
||||||
Command: "rm -f $out && cp $cpPreserveSymlinks $cpFlags $in $out && chmod +x $out",
|
Command: "rm -f $out && cp $cpPreserveSymlinks $cpFlags $in $out && chmod +x $out",
|
||||||
|
@@ -437,13 +437,13 @@ func (l *lintSingleton) copyLintDependencies(ctx android.SingletonContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ctx.Build(pctx, android.BuildParams{
|
ctx.Build(pctx, android.BuildParams{
|
||||||
Rule: android.Cp,
|
Rule: android.CpIfChanged,
|
||||||
Input: android.OutputFileForModule(ctx, frameworkDocStubs, ".annotations.zip"),
|
Input: android.OutputFileForModule(ctx, frameworkDocStubs, ".annotations.zip"),
|
||||||
Output: copiedAnnotationsZipPath(ctx),
|
Output: copiedAnnotationsZipPath(ctx),
|
||||||
})
|
})
|
||||||
|
|
||||||
ctx.Build(pctx, android.BuildParams{
|
ctx.Build(pctx, android.BuildParams{
|
||||||
Rule: android.Cp,
|
Rule: android.CpIfChanged,
|
||||||
Input: android.OutputFileForModule(ctx, frameworkDocStubs, ".api_versions.xml"),
|
Input: android.OutputFileForModule(ctx, frameworkDocStubs, ".api_versions.xml"),
|
||||||
Output: copiedAPIVersionsXmlPath(ctx),
|
Output: copiedAPIVersionsXmlPath(ctx),
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user