diff options
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 |
commit | f1a035e6be35d5678ce2e86bf3bc83fd5e4b4dc2 (patch) | |
tree | 097d3f1f4bf617eb5596166ee1803e3fd4b738c4 /python | |
parent | 33e17630944359f752cb4abcc80f79b2273645b8 (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 'python')
-rw-r--r-- | python/proto.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/proto.go b/python/proto.go index b71e047a5..53ebb5895 100644 --- a/python/proto.go +++ b/python/proto.go @@ -24,17 +24,17 @@ func genProto(ctx android.ModuleContext, protoFile android.Path, flags android.P outDir := srcsZipFile.ReplaceExtension(ctx, "tmp") depFile := srcsZipFile.ReplaceExtension(ctx, "srcszip.d") - rule := android.NewRuleBuilder() + rule := android.NewRuleBuilder(pctx, ctx) rule.Command().Text("rm -rf").Flag(outDir.String()) rule.Command().Text("mkdir -p").Flag(outDir.String()) - android.ProtoRule(ctx, rule, protoFile, flags, flags.Deps, outDir, depFile, nil) + android.ProtoRule(rule, protoFile, flags, flags.Deps, outDir, depFile, nil) // Proto generated python files have an unknown package name in the path, so package the entire output directory // into a srcszip. zipCmd := rule.Command(). - BuiltTool(ctx, "soong_zip"). + BuiltTool("soong_zip"). FlagWithOutput("-o ", srcsZipFile) if pkgPath != "" { zipCmd.FlagWithArg("-P ", pkgPath) @@ -44,7 +44,7 @@ func genProto(ctx android.ModuleContext, protoFile android.Path, flags android.P rule.Command().Text("rm -rf").Flag(outDir.String()) - rule.Build(pctx, ctx, "protoc_"+protoFile.Rel(), "protoc "+protoFile.Rel()) + rule.Build("protoc_"+protoFile.Rel(), "protoc "+protoFile.Rel()) return srcsZipFile } |