summaryrefslogtreecommitdiff
path: root/java/builder.go
diff options
context:
space:
mode:
author Dan Willemsen <dwillemsen@google.com> 2015-11-17 15:27:28 -0800
committer Dan Willemsen <dwillemsen@google.com> 2015-11-17 19:05:07 -0800
commitc94a768a2a6998a34f76212912ce4013a7be47f5 (patch)
tree0420066908ab1d2efaa14953a2a84282c18f4b33 /java/builder.go
parent322a0a6b59dfe5d059b7075cd033dc0bcb49dc13 (diff)
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
Diffstat (limited to 'java/builder.go')
-rw-r--r--java/builder.go21
1 files changed, 9 insertions, 12 deletions
diff --git a/java/builder.go b/java/builder.go
index 4eda6adf2..36506ae0e 100644
--- a/java/builder.go
+++ b/java/builder.go
@@ -52,6 +52,7 @@ var (
jar = pctx.StaticRule("jar",
blueprint.RuleParams{
Command: `$jarCmd -o $out $jarArgs`,
+ CommandDeps: []string{"$jarCmd"},
Description: "jar $out",
},
"jarCmd", "jarArgs")
@@ -61,6 +62,7 @@ var (
Command: `rm -rf "$outDir" && mkdir -p "$outDir" && ` +
`$dxCmd --dex --output=$outDir $dxFlags $in || ( rm -rf "$outDir"; exit 41 ) && ` +
`find "$outDir" -name "classes*.dex" > $out`,
+ CommandDeps: []string{"$dxCmd"},
Description: "dex $out",
},
"outDir", "dxFlags")
@@ -68,6 +70,7 @@ var (
jarjar = pctx.StaticRule("jarjar",
blueprint.RuleParams{
Command: "java -jar $jarjarCmd process $rulesFile $in $out",
+ CommandDeps: []string{"$jarjarCmd", "$rulesFile"},
Description: "jarjar $out",
},
"rulesFile")
@@ -156,8 +159,6 @@ func TransformClassesToJar(ctx common.AndroidModuleContext, classes []jarSpec,
jarArgs = append(jarArgs, "-m "+manifest)
}
- deps = append(deps, "$jarCmd")
-
ctx.Build(pctx, blueprint.BuildParams{
Rule: jar,
Outputs: []string{outputFile},
@@ -177,10 +178,9 @@ func TransformClassesJarToDex(ctx common.AndroidModuleContext, classesJar string
outputFile := filepath.Join(common.ModuleOutDir(ctx), "dex.filelist")
ctx.Build(pctx, blueprint.BuildParams{
- Rule: dx,
- Outputs: []string{outputFile},
- Inputs: []string{classesJar},
- Implicits: []string{"$dxCmd"},
+ Rule: dx,
+ Outputs: []string{outputFile},
+ Inputs: []string{classesJar},
Args: map[string]string{
"dxFlags": flags.dxFlags,
"outDir": outDir,
@@ -205,8 +205,6 @@ func TransformDexToJavaLib(ctx common.AndroidModuleContext, resources []jarSpec,
deps = append(deps, dexJarSpec.fileList)
jarArgs = append(jarArgs, dexJarSpec.soongJarArgs())
- deps = append(deps, "$jarCmd")
-
ctx.Build(pctx, blueprint.BuildParams{
Rule: jar,
Outputs: []string{outputFile},
@@ -222,10 +220,9 @@ func TransformDexToJavaLib(ctx common.AndroidModuleContext, resources []jarSpec,
func TransformJarJar(ctx common.AndroidModuleContext, classesJar string, rulesFile string) string {
outputFile := filepath.Join(common.ModuleOutDir(ctx), "classes-jarjar.jar")
ctx.Build(pctx, blueprint.BuildParams{
- Rule: jarjar,
- Outputs: []string{outputFile},
- Inputs: []string{classesJar},
- Implicits: []string{"$jarjarCmd"},
+ Rule: jarjar,
+ Outputs: []string{outputFile},
+ Inputs: []string{classesJar},
Args: map[string]string{
"rulesFile": rulesFile,
},