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_library") 16load("//tests/analysis:for_test.bzl", "rules_for_test") 17load("//tests/analysis:jvm_library_test.bzl", "jvm_library_test") 18load("//tests/analysis:util.bzl", "ONLY_FOR_ANALYSIS_TEST_TAGS") 19 20package( 21 default_testonly = True, 22 default_visibility = ["//tests/analysis/jvm_library/friends:__subpackages__"], 23) 24 25licenses(["notice"]) 26 27jvm_library_test( 28 name = "has_kt_exported_friend_impl_package_test", 29 expected_friend_jar_names = [ 30 "libkt_exports_friend-compile.jar", 31 "libfriend-compile.jar", 32 ], 33 target_under_test = rules_for_test.kt_jvm_library( 34 name = "has_kt_exported_friend_impl_package", 35 srcs = ["Input.kt"], 36 deps = [":kt_exports_friend"], 37 ), 38) 39 40jvm_library_test( 41 name = "has_direct_friend_impl_package_test", 42 expected_friend_jar_names = [ 43 "libfriend-compile.jar", 44 ], 45 target_under_test = rules_for_test.kt_jvm_library( 46 name = "has_direct_friend_impl_package", 47 srcs = ["Input.kt"], 48 deps = ["//tests/analysis/jvm_library/friends:friend"], 49 ), 50) 51 52jvm_library_test( 53 name = "no_kt_exported_friend_sibling_package_test", 54 expected_friend_jar_names = [ 55 "libkt_exports_subfriend-compile.jar", 56 # Absent # "subfriend-compile.jar" 57 ], 58 target_under_test = rules_for_test.kt_jvm_library( 59 name = "no_kt_exported_friend_sibling_package", 60 srcs = ["Input.kt"], 61 deps = [":kt_exports_subfriend"], 62 ), 63) 64 65jvm_library_test( 66 name = "no_direct_friend_sibling_package_test", 67 expected_friend_jar_names = [], 68 target_under_test = rules_for_test.kt_jvm_library( 69 name = "no_direct_friend_sibling_package", 70 srcs = ["Input.kt"], 71 deps = ["//tests/analysis/jvm_library/friends/sub:subfriend"], 72 ), 73) 74 75kt_jvm_library( 76 name = "kt_exports_subfriend", 77 srcs = ["Input.kt"], 78 tags = ONLY_FOR_ANALYSIS_TEST_TAGS, 79 exports = ["//tests/analysis/jvm_library/friends/sub:subfriend"], 80) 81 82kt_jvm_library( 83 name = "kt_exports_friend", 84 srcs = ["Input.kt"], 85 tags = ONLY_FOR_ANALYSIS_TEST_TAGS, 86 exports = ["//tests/analysis/jvm_library/friends:friend"], 87) 88 89kt_jvm_library( 90 name = "testingfriend", 91 srcs = ["Input.kt"], 92 tags = ONLY_FOR_ANALYSIS_TEST_TAGS, 93) 94