summaryrefslogtreecommitdiff
path: root/rust/protobuf.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2020-11-16 17:32:30 -0800
committer Colin Cross <ccross@android.com> 2020-12-01 16:22:16 -0800
commitf1a035e6be35d5678ce2e86bf3bc83fd5e4b4dc2 (patch)
tree097d3f1f4bf617eb5596166ee1803e3fd4b738c4 /rust/protobuf.go
parent33e17630944359f752cb4abcc80f79b2273645b8 (diff)
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
Diffstat (limited to 'rust/protobuf.go')
-rw-r--r--rust/protobuf.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/rust/protobuf.go b/rust/protobuf.go
index 235b4ad2b..0e7908950 100644
--- a/rust/protobuf.go
+++ b/rust/protobuf.go
@@ -93,7 +93,7 @@ func (proto *protobufDecorator) GenerateSource(ctx ModuleContext, deps PathDeps)
// stemFile must be first here as the first path in BaseSourceProvider.OutputFiles is the library entry-point.
outputs := android.WritablePaths{stemFile}
- rule := android.NewRuleBuilder()
+ rule := android.NewRuleBuilder(pctx, ctx)
for _, protoFile := range protoFiles {
protoName := strings.TrimSuffix(protoFile.Base(), ".proto")
protoNames = append(protoNames, protoName)
@@ -108,7 +108,7 @@ func (proto *protobufDecorator) GenerateSource(ctx ModuleContext, deps PathDeps)
depFile := android.PathForModuleOut(ctx, protoName+".d")
- android.ProtoRule(ctx, rule, protoFile, protoFlags, protoFlags.Deps, outDir, depFile, ruleOutputs)
+ android.ProtoRule(rule, protoFile, protoFlags, protoFlags.Deps, outDir, depFile, ruleOutputs)
outputs = append(outputs, ruleOutputs...)
}
@@ -117,7 +117,7 @@ func (proto *protobufDecorator) GenerateSource(ctx ModuleContext, deps PathDeps)
Text("printf '" + proto.genModFileContents(ctx, protoNames) + "' >").
Output(stemFile)
- rule.Build(pctx, ctx, "protoc_"+ctx.ModuleName(), "protoc "+ctx.ModuleName())
+ rule.Build("protoc_"+ctx.ModuleName(), "protoc "+ctx.ModuleName())
proto.BaseSourceProvider.OutputFiles = outputs.Paths()