blob: 00d75a9ca10cb1a41a30bb4eae174fd982f12aff [file]
# Copyright 2018 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load("@com_github_jetbrains_kotlin//:artifacts.bzl", "KOTLIN_STDLIBS")
load("@rules_java//java:defs.bzl", "java_binary", "java_import")
java_import(
name = "worker",
jars = ["kotlin_worker.jar"],
)
java_import(
name = "jdeps_merger_worker",
jars = ["jdeps_merger_worker.jar"],
)
java_import(
name = "ksp2_worker",
jars = ["ksp2_worker.jar"],
)
java_import(
name = "ksp2_invoker",
jars = ["ksp2_invoker.jar"],
visibility = ["//visibility:public"],
)
java_import(
name = "skip-code-gen",
jars = ["skip-code-gen.jar"],
)
java_import(
name = "jdeps-gen",
jars = ["jdeps-gen.jar"],
)
java_binary(
name = "build",
data = [
":jdeps-gen",
":skip-code-gen",
"//kotlin/compiler:jvm-abi-gen",
"//kotlin/compiler:kotlin-annotation-processing",
"//kotlin/compiler:kotlin-compiler",
"//kotlin/compiler:kotlin-reflect",
"//src/main/kotlin/io/bazel/kotlin/compiler",
"@com_github_jetbrains_kotlin//:home",
"@kotlin_build_tools_impl//file",
"@kotlinx_serialization_core_jvm//file",
"@kotlinx_serialization_json//file",
"@kotlinx_serialization_json_jvm//file",
],
jvm_flags = [
"-D@com_github_jetbrains_kotlinx...serialization-core-jvm=$(rlocationpath @kotlinx_serialization_core_jvm//file)",
"-D@com_github_jetbrains_kotlinx...serialization-json=$(rlocationpath @kotlinx_serialization_json//file)",
"-D@com_github_jetbrains_kotlinx...serialization-json-jvm=$(rlocationpath @kotlinx_serialization_json_jvm//file)",
"-D@com_github_jetbrains_kotlin...build-tools-impl=$(rlocationpath @kotlin_build_tools_impl//file)",
"-D@com_github_jetbrains_kotlin...jvm-abi-gen=$(rlocationpath //kotlin/compiler:jvm-abi-gen)",
"-D@com_github_jetbrains_kotlin...kotlin-compiler=$(rlocationpath //kotlin/compiler:kotlin-compiler)",
"-D@com_github_jetbrains_kotlin...kapt=$(rlocationpath //kotlin/compiler:kotlin-annotation-processing)",
"-D@rules_kotlin...jdeps-gen=$(rlocationpath //src/main/kotlin:jdeps-gen)",
"-D@rules_kotlin...skip-code-gen=$(rlocationpath //src/main/kotlin:skip-code-gen)",
"-D@rules_kotlin...compiler=$(rlocationpath //src/main/kotlin/io/bazel/kotlin/compiler)",
"-D@rules_kotlin..kotlin.compiler.kotlin-reflect=$(rlocationpath //kotlin/compiler:kotlin-reflect)",
"-XX:-MaxFDLimit",
],
main_class = "io.bazel.kotlin.builder.cmd.Build",
visibility = ["//visibility:public"],
runtime_deps = [
# Added separately to make sure it comes first, otherwise buildifier sorts it
"@bazel_tools//tools/jdk:JacocoCoverage",
] + [
":worker",
] + KOTLIN_STDLIBS,
)
java_binary(
name = "jdeps_merger",
data = KOTLIN_STDLIBS,
jvm_flags = [
"-XX:-MaxFDLimit",
],
main_class = "io.bazel.kotlin.builder.cmd.MergeJdepsMain",
visibility = ["//visibility:public"],
runtime_deps = [":jdeps_merger_worker"],
)
java_binary(
name = "ksp2",
data = KOTLIN_STDLIBS,
jvm_flags = [
"-XX:-MaxFDLimit",
],
main_class = "io.bazel.kotlin.builder.cmd.Ksp2",
visibility = ["//visibility:public"],
runtime_deps = [":ksp2_worker"],
)