From 19878da6a062ef474a1c905f48b1efb986862050 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 28 Mar 2019 14:45:07 -0700 Subject: Move proto compilation to RuleBuilder Using blueprint.Rule for protoc commands was causing code duplication because there was no good way to run the same protoc for cc, java and python but then run custom source packaging steps for java and python. Move most of the code into a common function that returns a RuleBuilder, and then let java and python add their own commands at the end of the rule. Bug: 70706119 Test: All Soong tests Test: m checkbuild Change-Id: Ic692136775d273bcc4f4de99620ab4878667c83a --- python/python.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'python/python.go') diff --git a/python/python.go b/python/python.go index 6eb9b6ef3..3c3c396a4 100644 --- a/python/python.go +++ b/python/python.go @@ -516,9 +516,11 @@ func (p *Module) createSrcsZip(ctx android.ModuleContext, pkgPath string) androi } var zips android.Paths if len(protoSrcs) > 0 { + protoFlags := android.GetProtoFlags(ctx, &p.protoProperties) + protoFlags.OutTypeFlag = "--python_out" + for _, srcFile := range protoSrcs { - zip := genProto(ctx, &p.protoProperties, srcFile, - android.ProtoFlags(ctx, &p.protoProperties), pkgPath) + zip := genProto(ctx, srcFile, protoFlags, pkgPath) zips = append(zips, zip) } } -- cgit v1.2.3-59-g8ed1b