• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2024 The Bazel Authors. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#    http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14"""Support for Java compilation of protocol buffer generated code."""
15
16load("@compatibility_proxy//:proxy.bzl", "java_common", "java_common_internal_compile", "java_info_internal_merge")
17
18def 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)
28
29def 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)
38