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/java/boot_jars.go b/java/boot_jars.go
index e706547..823275b 100644
--- a/java/boot_jars.go
+++ b/java/boot_jars.go
@@ -85,8 +85,8 @@
timestamp := android.PathForOutput(ctx, "boot-jars-package-check/stamp")
- rule := android.NewRuleBuilder()
- checkBootJars := rule.Command().BuiltTool(ctx, "check_boot_jars").
+ rule := android.NewRuleBuilder(pctx, ctx)
+ checkBootJars := rule.Command().BuiltTool("check_boot_jars").
Input(ctx.Config().HostToolPath(ctx, "dexdump")).
Input(android.PathForSource(ctx, "build/soong/scripts/check_boot_jars/package_allowed_list.txt"))
@@ -109,7 +109,7 @@
}
checkBootJars.Text("&& touch").Output(timestamp)
- rule.Build(pctx, ctx, "boot_jars_package_check", "check boot jar packages")
+ rule.Build("boot_jars_package_check", "check boot jar packages")
// The check-boot-jars phony target depends on the timestamp created if the check succeeds.
ctx.Phony("check-boot-jars", timestamp)