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