Use Rule-local implicit dependencies

Depends on https://github.com/google/blueprint/pull/78

This uses the new CommandDeps field to move implicit dependencies
embedded in the Command string next to the definition, instead of having
to specify them in every BuildParam struct. This should make it easier
to verify dependencies.

Change-Id: I2711b160920e22fa962a436e1f7041272166f50f
This commit is contained in:
Dan Willemsen
2015-11-17 15:27:28 -08:00
parent 322a0a6b59
commit c94a768a2a
8 changed files with 67 additions and 74 deletions

View File

@@ -44,6 +44,7 @@ var (
aidl = pctx.StaticRule("aidl",
blueprint.RuleParams{
Command: "$aidlCmd -d$depFile $aidlFlags $in $out",
CommandDeps: []string{"$aidlCmd"},
Description: "aidl $out",
},
"depFile", "aidlFlags")
@@ -51,12 +52,14 @@ var (
logtags = pctx.StaticRule("logtags",
blueprint.RuleParams{
Command: "$logtagsCmd -o $out $in $allLogtagsFile",
CommandDeps: []string{"$logtagsCmd"},
Description: "logtags $out",
})
mergeLogtags = pctx.StaticRule("mergeLogtags",
blueprint.RuleParams{
Command: "$mergeLogtagsCmd -o $out $in",
CommandDeps: []string{"$mergeLogtagsCmd"},
Description: "merge logtags $out",
})
)
@@ -68,10 +71,9 @@ func genAidl(ctx common.AndroidModuleContext, aidlFile, aidlFlags string) string
depFile := javaFile + ".d"
ctx.Build(pctx, blueprint.BuildParams{
Rule: aidl,
Outputs: []string{javaFile},
Inputs: []string{aidlFile},
Implicits: []string{"$aidlCmd"},
Rule: aidl,
Outputs: []string{javaFile},
Inputs: []string{aidlFile},
Args: map[string]string{
"depFile": depFile,
"aidlFlags": aidlFlags,
@@ -87,10 +89,9 @@ func genLogtags(ctx common.AndroidModuleContext, logtagsFile string) string {
javaFile = pathtools.ReplaceExtension(javaFile, "java")
ctx.Build(pctx, blueprint.BuildParams{
Rule: logtags,
Outputs: []string{javaFile},
Inputs: []string{logtagsFile},
Implicits: []string{"$logtagsCmd"},
Rule: logtags,
Outputs: []string{javaFile},
Inputs: []string{logtagsFile},
})
return javaFile