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/sdk.go b/java/sdk.go
index 971791f..32a4b5a 100644
--- a/java/sdk.go
+++ b/java/sdk.go
@@ -544,7 +544,7 @@
commitChangeForRestat(rule, tempPath, combinedAidl)
- rule.Build(pctx, ctx, "framework_aidl", "generate framework.aidl")
+ rule.Build("framework_aidl", "generate framework.aidl")
}
// Creates a version of framework.aidl for the non-updatable part of the platform.
@@ -558,7 +558,7 @@
commitChangeForRestat(rule, tempPath, combinedAidl)
- rule.Build(pctx, ctx, "framework_non_updatable_aidl", "generate framework_non_updatable.aidl")
+ rule.Build("framework_non_updatable_aidl", "generate framework_non_updatable.aidl")
}
func createFrameworkAidl(stubsModules []string, path android.OutputPath, ctx android.SingletonContext) *android.RuleBuilder {
@@ -586,7 +586,7 @@
}
}
- rule := android.NewRuleBuilder()
+ rule := android.NewRuleBuilder(pctx, ctx)
rule.MissingDeps(missingDeps)
var aidls android.Paths
@@ -597,7 +597,7 @@
rule.Command().
Text("rm -f").Output(aidl)
rule.Command().
- BuiltTool(ctx, "sdkparcelables").
+ BuiltTool("sdkparcelables").
Input(jar).
Output(aidl)
@@ -632,7 +632,7 @@
func createAPIFingerprint(ctx android.SingletonContext) {
out := ApiFingerprintPath(ctx)
- rule := android.NewRuleBuilder()
+ rule := android.NewRuleBuilder(pctx, ctx)
rule.Command().
Text("rm -f").Output(out)
@@ -659,7 +659,7 @@
Output(out)
}
- rule.Build(pctx, ctx, "api_fingerprint", "generate api_fingerprint.txt")
+ rule.Build("api_fingerprint", "generate api_fingerprint.txt")
}
func ApiFingerprintPath(ctx android.PathContext) android.OutputPath {