xref: /aosp_15_r20/external/bazelbuild-kotlin-rules/toolchains/kotlin_jvm/java_toolchains.bzl (revision 3a22c0a33dd99bcca39a024d43e6fbcc55c2806e)
1*3a22c0a3SAlix# Copyright 2022 Google LLC. All rights reserved.
2*3a22c0a3SAlix#
3*3a22c0a3SAlix# Licensed under the Apache License, Version 2.0 (the License);
4*3a22c0a3SAlix# you may not use this file except in compliance with the License.
5*3a22c0a3SAlix# You may obtain a copy of the License at
6*3a22c0a3SAlix#
7*3a22c0a3SAlix#     http://www.apache.org/licenses/LICENSE-2.0
8*3a22c0a3SAlix#
9*3a22c0a3SAlix# Unless required by applicable law or agreed to in writing, software
10*3a22c0a3SAlix# distributed under the License is distributed on an "AS IS" BASIS,
11*3a22c0a3SAlix# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*3a22c0a3SAlix# See the License for the specific language governing permissions and
13*3a22c0a3SAlix# limitations under the License.
14*3a22c0a3SAlix
15*3a22c0a3SAlix"""Java toolchain for Kotlin."""
16*3a22c0a3SAlix
17*3a22c0a3SAlixload("//:visibility.bzl", "RULES_DEFS_THAT_COMPILE_KOTLIN")
18*3a22c0a3SAlix
19*3a22c0a3SAlixvisibility(RULES_DEFS_THAT_COMPILE_KOTLIN)
20*3a22c0a3SAlix
21*3a22c0a3SAlix_ATTRS = dict(
22*3a22c0a3SAlix    _java_toolchain = attr.label(
23*3a22c0a3SAlix        default = Label(
24*3a22c0a3SAlix            "@bazel_tools//tools/jdk:current_java_toolchain",
25*3a22c0a3SAlix        ),
26*3a22c0a3SAlix    ),
27*3a22c0a3SAlix)
28*3a22c0a3SAlix
29*3a22c0a3SAlixjava_toolchains = struct(
30*3a22c0a3SAlix    get = lambda ctx: ctx.attr._java_toolchain[java_common.JavaToolchainInfo],
31*3a22c0a3SAlix    attrs = _ATTRS,
32*3a22c0a3SAlix)
33