From f1a035e6be35d5678ce2e86bf3bc83fd5e4b4dc2 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 16 Nov 2020 17:32:30 -0800 Subject: 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 --- python/proto.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'python/proto.go') 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 } -- cgit v1.2.3-59-g8ed1b