@@ -296,9 +296,6 @@ _kt_jvm_proto_library_helper = rule(
296296 proto_deps = attr .label_list (
297297 providers = [ProtoInfo ],
298298 ),
299- deps = attr .label_list (
300- providers = [JavaInfo ],
301- ),
302299 exports = attr .label_list (
303300 allow_rules = ["java_proto_library" ],
304301 ),
@@ -321,7 +318,8 @@ _kt_jvm_proto_library_helper = rule(
321318
322319def kt_jvm_proto_library (
323320 name ,
324- deps = None ,
321+ proto_deps = None ,
322+ deps = [],
325323 java_deps = None ,
326324 tags = None ,
327325 testonly = None ,
@@ -331,9 +329,7 @@ def kt_jvm_proto_library(
331329 flavor = None ,
332330 deprecation = None ,
333331 features = []):
334- """
335- This rule accepts any number of proto_library targets in "deps", translates them to Kotlin and
336- returns the compiled Kotlin.
332+ """This macro takes protos, Java deps, and Kotlin deps, and returns the compiled Kotlin.
337333
338334 See also https://developers.google.com/protocol-buffers/docs/kotlintutorial for how to interact
339335 with the generated Kotlin representation.
@@ -347,8 +343,9 @@ def kt_jvm_proto_library(
347343
348344 Args:
349345 name: A name for the target
350- deps: One or more proto_library targets to turn into Kotlin.
351- java_deps: (optional) java_proto_library targets corresponding to deps
346+ proto_deps: One or more proto_library targets to turn into Kotlin
347+ deps: One or more Java/Kotlin library targets to depend on
348+ java_deps: (optional) java_proto_library targets corresponding to proto_deps
352349 tags: Standard attribute
353350 testonly: Standard attribute
354351 compatible_with: Standard attribute
@@ -367,7 +364,7 @@ def kt_jvm_proto_library(
367364 if flavor == "lite" :
368365 native .java_lite_proto_library (
369366 name = java_proto_target [1 :],
370- deps = deps ,
367+ deps = proto_deps ,
371368 testonly = testonly ,
372369 compatible_with = compatible_with ,
373370 visibility = ["//visibility:private" ],
@@ -379,7 +376,7 @@ def kt_jvm_proto_library(
379376 else :
380377 native .java_proto_library (
381378 name = java_proto_target [1 :],
382- deps = deps ,
379+ deps = proto_deps ,
383380 testonly = testonly ,
384381 compatible_with = compatible_with ,
385382 visibility = ["//visibility:private" ],
@@ -394,8 +391,7 @@ def kt_jvm_proto_library(
394391 helper_target = ":%s_DO_NOT_DEPEND_kt_proto" % name
395392 _kt_jvm_proto_library_helper (
396393 name = helper_target [1 :],
397- proto_deps = deps ,
398- deps = java_protos ,
394+ proto_deps = proto_deps ,
399395 testonly = testonly ,
400396 compatible_with = compatible_with ,
401397 visibility = ["//visibility:private" ],
@@ -410,7 +406,7 @@ def kt_jvm_proto_library(
410406 srcs = [helper_target + ".srcjar" ],
411407 deps = [
412408 "@maven//:com_google_protobuf_protobuf_kotlin" ,
413- ] + java_protos ,
409+ ] + java_protos + deps ,
414410 exports = java_exports ,
415411 testonly = testonly ,
416412 compatible_with = compatible_with ,
0 commit comments