Skip to content

Commit 7517ac6

Browse files
comiuscopybara-github
authored andcommitted
Expose symbols needed to support Java proto libraries
BEGIN_PUBLIC Expose symbols needed to support Java proto libraries END_PUBLIC PiperOrigin-RevId: 654697985 Change-Id: Ie4b3a81e9f6139dd7f13a4e171ccf4cffcf17a1c
1 parent 38cdd62 commit 7517ac6

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

java/private/proto_support.bzl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
16+
load("//java/private:native.bzl", "native_java_common")
17+
18+
visibility(["//third_party/protobuf/..."])
19+
20+
# Partial support, because internal symbols are not available in older Bazel version
21+
# TODO: Once Java rules are moved into the rules_java, this should become a full support.
22+
23+
def compile(*, injecting_rule_kind, enable_jspecify, include_compilation_info, **kwargs): # buildifier: disable=unused-variable
24+
return native_java_common.compile(**kwargs)
25+
26+
def merge(providers, *, merge_java_outputs = True, merge_source_jars = True): # buildifier: disable=unused-variable
27+
return native_java_common.merge(providers)

java/private/proto_support.bzl.oss

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
16+
load("//third_party/bazel_rules/rules_java/java/private:native.bzl", "native_java_common")
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.
20+
21+
def compile(*, injecting_rule_kind, enable_jspecify, include_compilation_info, **kwargs): # buildifier: disable=unused-variable
22+
return native_java_common.compile(**kwargs)
23+
24+
def merge(providers, *, merge_java_outputs = True, merge_source_jars = True): # buildifier: disable=unused-variable
25+
return native_java_common.merge(providers)

0 commit comments

Comments
 (0)