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/common/testing:testing_rules.bzl", "kt_testing_rules") 16load("//kotlin/jvm/testing:for_analysis.bzl", ktfa = "kt_for_analysis") 17 18package( 19 default_applicable_licenses = ["//:license"], 20 default_testonly = True, 21) 22 23licenses(["notice"]) 24 25kt_testing_rules.assert_failure_test( 26 name = "has_forbidden_nano_dep_test", 27 msg_contains = "fake_nano_proto_lib", 28 target_under_test = ktfa.kt_jvm_library( 29 name = "has_forbidden_nano_dep", 30 srcs = ["Inputs.kt"], 31 deps = [":fake_nano_proto_lib"], 32 ), 33) 34 35kt_testing_rules.assert_failure_test( 36 name = "dep_on_has_forbidden_nano_export_test", 37 msg_contains = "fake_nano_proto_lib", 38 target_under_test = ktfa.kt_jvm_library( 39 name = "dep_on_has_forbidden_nano_export", 40 srcs = ["Input.kt"], 41 deps = [ 42 ktfa.java_library( 43 name = "has_forbidden_nano_export", 44 exports = [":fake_nano_proto_lib"], 45 ), 46 ], 47 ), 48) 49 50ktfa.java_library( 51 name = "fake_nano_proto_lib", 52 srcs = [], 53 tags = ["nano_proto_library"], 54) 55