|
13 | 13 | # limitations under the License. |
14 | 14 | """Support for Java compilation of protocol buffer generated code.""" |
15 | 15 |
|
16 | | -load("@compatibility_proxy//:proxy.bzl", "java_common") |
| 16 | +load("@compatibility_proxy//:proxy.bzl", "java_common", "java_common_internal_compile", "java_info_internal_merge") |
17 | 17 |
|
18 | | -# Partial support, because internal symbols are not available in older Bazel version |
19 | | -# TODO: Once Java rules are moved into the rules_java, this should become a full support. |
| 18 | +def compile(*, injecting_rule_kind, enable_jspecify, include_compilation_info, **kwargs): |
| 19 | + if java_common_internal_compile: |
| 20 | + return java_common_internal_compile( |
| 21 | + injecting_rule_kind = injecting_rule_kind, |
| 22 | + enable_jspecify = enable_jspecify, |
| 23 | + include_compilation_info = include_compilation_info, |
| 24 | + **kwargs |
| 25 | + ) |
| 26 | + else: |
| 27 | + return java_common.compile(**kwargs) |
20 | 28 |
|
21 | | -def compile(*, injecting_rule_kind, enable_jspecify, include_compilation_info, **kwargs): # buildifier: disable=unused-variable |
22 | | - return java_common.compile(**kwargs) |
23 | | - |
24 | | -def merge(providers, *, merge_java_outputs = True, merge_source_jars = True): # buildifier: disable=unused-variable |
25 | | - return java_common.merge(providers) |
| 29 | +def merge(providers, *, merge_java_outputs = True, merge_source_jars = True): |
| 30 | + if java_info_internal_merge: |
| 31 | + return java_info_internal_merge( |
| 32 | + providers, |
| 33 | + merge_java_outputs = merge_java_outputs, |
| 34 | + merge_source_jars = merge_source_jars, |
| 35 | + ) |
| 36 | + else: |
| 37 | + return java_common.merge(providers) |
0 commit comments