diff options
| author | 2023-10-03 09:58:34 -0700 | |
|---|---|---|
| committer | 2023-10-05 12:53:23 -0700 | |
| commit | dbaf6a9dd09d69d3215fdcba2df99e10c64404c3 (patch) | |
| tree | 00f6b51f7f0fc4566bb27ce0a2d09e58359b8170 /java/proto.go | |
| parent | 0b5a877f21d514a0a6fe2773a381f2ce701cdda7 (diff) | |
Add support for java_library proto plugin in bp2build
Test: Added unit test and CI
Bug: 303064670
Change-Id: Idb96ac322aafcb6789ea2002b84a6905d5ec488f
Diffstat (limited to 'java/proto.go')
| -rw-r--r-- | java/proto.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/java/proto.go b/java/proto.go index 48adadcc9..c88d3d7fc 100644 --- a/java/proto.go +++ b/java/proto.go @@ -159,6 +159,8 @@ type protoAttributes struct { Sdk_version bazel.StringAttribute Java_version bazel.StringAttribute + + Plugin bazel.LabelAttribute } func bp2buildProto(ctx android.Bp2buildMutatorContext, m *Module, protoSrcs bazel.LabelListAttribute, AdditionalProtoDeps bazel.LabelListAttribute) *bazel.Label { @@ -189,12 +191,18 @@ func bp2buildProto(ctx android.Bp2buildMutatorContext, m *Module, protoSrcs baze ctx.PropertyErrorf("proto.type", "cannot handle conversion at this time: %q", typ) } + plugin := bazel.LabelAttribute{} + if m.protoProperties.Proto.Plugin != nil { + plugin.SetValue(android.BazelLabelForModuleDepSingle(ctx, "protoc-gen-"+*m.protoProperties.Proto.Plugin)) + } + protoAttrs := &protoAttributes{ Deps: bazel.MakeLabelListAttribute(protoInfo.Proto_libs), Transitive_deps: bazel.MakeLabelListAttribute(protoInfo.Transitive_proto_libs), Additional_proto_deps: AdditionalProtoDeps, Java_version: bazel.StringAttribute{Value: m.properties.Java_version}, Sdk_version: bazel.StringAttribute{Value: m.deviceProperties.Sdk_version}, + Plugin: plugin, } name := m.Name() + suffix |