diff options
author | Colin Cross <ccross@android.com> | 2019-03-28 19:30:56 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2019-04-02 16:38:55 +0000 |
commit | fe17f6f0e825b42542b4527c19cdd7b520ca5133 (patch) | |
tree | 496b65489ee342024f22129edd4ad98e21ac1f33 /python | |
parent | 19878da6a062ef474a1c905f48b1efb986862050 (diff) | |
download | build_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.go | 2 | ||||
-rw-r--r-- | python/python.go | 2 |
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") } |