aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2019-03-28 19:30:56 -0700
committerColin Cross <ccross@android.com>2019-04-02 16:38:55 +0000
commitfe17f6f0e825b42542b4527c19cdd7b520ca5133 (patch)
tree496b65489ee342024f22129edd4ad98e21ac1f33 /python
parent19878da6a062ef474a1c905f48b1efb986862050 (diff)
downloadbuild_soong-fe17f6f0e825b42542b4527c19cdd7b520ca5133.tar.gz
build_soong-fe17f6f0e825b42542b4527c19cdd7b520ca5133.tar.bz2
build_soong-fe17f6f0e825b42542b4527c19cdd7b520ca5133.zip
Add support for protoc plugins
Add a proto.plugin property to allow specifying a custom protoc plugin to generate the code. Fixes: 70706119 Test: m am StreamingProtoTest Change-Id: I1ecdd346284b42bbcc8297019d98d2cd564eb94c
Diffstat (limited to 'python')
-rw-r--r--python/proto.go2
-rw-r--r--python/python.go2
2 files changed, 3 insertions, 1 deletions
diff --git a/python/proto.go b/python/proto.go
index 813e91dd..b3ffaa67 100644
--- a/python/proto.go
+++ b/python/proto.go
@@ -29,7 +29,7 @@ func genProto(ctx android.ModuleContext, protoFile android.Path, flags android.P
rule.Command().Text("rm -rf").Flag(outDir.String())
rule.Command().Text("mkdir -p").Flag(outDir.String())
- android.ProtoRule(ctx, rule, protoFile, flags, nil, outDir, depFile, nil)
+ android.ProtoRule(ctx, 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.
diff --git a/python/python.go b/python/python.go
index 3c3c396a..ad089090 100644
--- a/python/python.go
+++ b/python/python.go
@@ -288,6 +288,8 @@ func (p *Module) hasSrcExt(ctx android.BottomUpMutatorContext, ext string) bool
}
func (p *Module) DepsMutator(ctx android.BottomUpMutatorContext) {
+ android.ProtoDeps(ctx, &p.protoProperties)
+
if p.hasSrcExt(ctx, protoExt) && p.Name() != "libprotobuf-python" {
ctx.AddVariationDependencies(nil, pythonLibTag, "libprotobuf-python")
}