xref: /aosp_15_r20/external/bazelbuild-kotlin-rules/tests/jvm/java/functions/car/BUILD (revision 3a22c0a33dd99bcca39a024d43e6fbcc55c2806e)
1# Copyright 2022 Google LLC. 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
15load("//kotlin:rules.bzl", "kt_jvm_import", "kt_jvm_library")
16
17package(
18    default_visibility = ["//tests/jvm/java/functions:__subpackages__"],
19)
20
21licenses(["notice"])
22
23# During coverage builds, every library gets a dep on JaCoCo (Java Code Coverage).
24# Libjars, from libraries, only include their direct sources. Together, these behaviours
25# trigger an ImportDepsChecker error for :car-jar and :car-inline-jar. To prevent that, we disable
26# coverage builds on all downstream targets.
27_NO_ZAPFHAHN_BECAUSE_LIBJARS_EXCLUDE_JACOCO = ["nozapfhahn"]
28
29kt_jvm_library(
30    name = "car_lib",
31    srcs = [
32        "Car.kt",
33        "CarUtils.kt",
34    ],
35)
36
37java_import(
38    name = "car_lib_import",
39    jars = [":libcar_lib.jar"],
40    tags = ["incomplete-deps"] + _NO_ZAPFHAHN_BECAUSE_LIBJARS_EXCLUDE_JACOCO,
41)
42
43kt_jvm_library(
44    name = "car_inline_lib",
45    srcs = [
46        "CarInlineUtils.kt",
47    ],
48    visibility = ["//visibility:private"],
49    deps = [
50        ":car_lib",
51    ],
52)
53
54kt_jvm_library(
55    name = "car_extra_lib",
56    srcs = [
57        "CarExtraUtils.kt",
58    ],
59    visibility = ["//visibility:private"],
60    deps = [
61        ":car_lib",
62    ],
63)
64
65kt_jvm_import(
66    name = "car_inline_and_extra_lib_import",
67    jars = [
68        ":libcar_inline_lib.jar",
69        ":libcar_extra_lib.jar",
70    ],
71    tags = _NO_ZAPFHAHN_BECAUSE_LIBJARS_EXCLUDE_JACOCO,
72    deps = [
73        ":car_lib_import",
74    ],
75)
76