summaryrefslogtreecommitdiff
path: root/java/proto.go
diff options
context:
space:
mode:
author Zi Wang <mrziwang@google.com> 2023-09-23 03:45:48 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2023-09-23 03:45:48 +0000
commit7c5b6d5273472f50f27597ece38f59e645c9826c (patch)
treedadb1804ec6bc2792d26c9d903b1371155378e7c /java/proto.go
parent11b20b2993977a66818b046563e4cadf5154c5c5 (diff)
parent4dbd0e868875c6a839fc00b62f3701f8d9db6445 (diff)
Merge "Pass java_library libs and static_libs to java_*_proto_library" into main
Diffstat (limited to 'java/proto.go')
-rw-r--r--java/proto.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/java/proto.go b/java/proto.go
index 2ed7b27e9..48adadcc9 100644
--- a/java/proto.go
+++ b/java/proto.go
@@ -151,11 +151,17 @@ type protoAttributes struct {
// a specific .proto file module explicitly.
Transitive_deps bazel.LabelListAttribute
+ // This is the libs and the static_libs of the original java_library module.
+ // On the bazel side, after proto sources are generated in java_*_proto_library, a java_library
+ // will compile them. The libs and static_libs from the original java_library module need
+ // to be linked because they are necessary in compile-time classpath.
+ Additional_proto_deps bazel.LabelListAttribute
+
Sdk_version bazel.StringAttribute
Java_version bazel.StringAttribute
}
-func bp2buildProto(ctx android.Bp2buildMutatorContext, m *Module, protoSrcs bazel.LabelListAttribute) *bazel.Label {
+func bp2buildProto(ctx android.Bp2buildMutatorContext, m *Module, protoSrcs bazel.LabelListAttribute, AdditionalProtoDeps bazel.LabelListAttribute) *bazel.Label {
protoInfo, ok := android.Bp2buildProtoProperties(ctx, &m.ModuleBase, protoSrcs)
if !ok {
return nil
@@ -184,10 +190,11 @@ func bp2buildProto(ctx android.Bp2buildMutatorContext, m *Module, protoSrcs baze
}
protoAttrs := &protoAttributes{
- Deps: bazel.MakeLabelListAttribute(protoInfo.Proto_libs),
- Transitive_deps: bazel.MakeLabelListAttribute(protoInfo.Transitive_proto_libs),
- Java_version: bazel.StringAttribute{Value: m.properties.Java_version},
- Sdk_version: bazel.StringAttribute{Value: m.deviceProperties.Sdk_version},
+ 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},
}
name := m.Name() + suffix