Add dependencies on golang tools
Add a dependency on the golang tool for each tool output file. This
will allow updating the go version without cleaning the output
directory.
Change-Id: I55048e96c8847635256bd9491e2cd12ddf29771b
diff --git a/blueprint/bootstrap/bootstrap.go b/blueprint/bootstrap/bootstrap.go
index 4257c8f..5a950f8 100644
--- a/blueprint/bootstrap/bootstrap.go
+++ b/blueprint/bootstrap/bootstrap.go
@@ -236,10 +236,11 @@
}
ctx.Build(pctx, blueprint.BuildParams{
- Rule: link,
- Outputs: []string{aoutFile},
- Inputs: []string{archiveFile},
- Args: linkArgs,
+ Rule: link,
+ Outputs: []string{aoutFile},
+ Inputs: []string{archiveFile},
+ Implicits: []string{"$linkCmd"},
+ Args: linkArgs,
})
ctx.Build(pctx, blueprint.BuildParams{
@@ -262,14 +263,14 @@
objFile := filepath.Join(objDir, "_go_.$GoChar")
var incFlags []string
- var depTargets []string
+ deps := []string{"$gcCmd"}
ctx.VisitDepsDepthFirstIf(isGoPackageProducer,
func(module blueprint.Module) {
dep := module.(goPackageProducer)
incDir := dep.GoPkgRoot()
target := dep.GoPackageTarget()
incFlags = append(incFlags, "-I "+incDir)
- depTargets = append(depTargets, target)
+ deps = append(deps, target)
})
gcArgs := map[string]string{
@@ -284,14 +285,15 @@
Rule: gc,
Outputs: []string{objFile},
Inputs: srcFiles,
- Implicits: depTargets,
+ Implicits: deps,
Args: gcArgs,
})
ctx.Build(pctx, blueprint.BuildParams{
- Rule: pack,
- Outputs: []string{archiveFile},
- Inputs: []string{objFile},
+ Rule: pack,
+ Outputs: []string{archiveFile},
+ Inputs: []string{objFile},
+ Implicits: []string{"$packCmd"},
Args: map[string]string{
"prefix": pkgRoot,
},