Pass pctx and ctx to NewRuleBuilder
Enable the RuleBuilder and RuleBuilderCommand methods to access
the BuilderContext by passing it to NewRuleBuilder instead of
RuleBuilder.Build.
Test: genrule_test.go
Test: rule_builder_test.go
Test: m checkbuild
Change-Id: I63e6597e19167393876dc2259d6f521363b7dabc
diff --git a/sdk/update.go b/sdk/update.go
index ba63542..377aaae 100644
--- a/sdk/update.go
+++ b/sdk/update.go
@@ -92,7 +92,7 @@
}
func (gf *generatedFile) build(pctx android.PackageContext, ctx android.BuilderContext, implicits android.Paths) {
- rb := android.NewRuleBuilder()
+ rb := android.NewRuleBuilder(pctx, ctx)
content := gf.content.String()
@@ -108,7 +108,7 @@
Text("| sed 's/\\\\n/\\n/g' >").Output(gf.path)
rb.Command().
Text("chmod a+x").Output(gf.path)
- rb.Build(pctx, ctx, gf.path.Base(), "Build "+gf.path.Base())
+ rb.Build(gf.path.Base(), "Build "+gf.path.Base())
}
// Collect all the members.