xref: /aosp_15_r20/external/bazelbuild-kotlin-rules/tests/jvm/java/ijar/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_library")
16
17licenses(["notice"])
18
19package(
20    default_testonly = 1,
21)
22
23java_test(
24    name = "ijar",
25    main_class = "ijar.MainKt",
26    runtime_deps = [":main"],
27)
28
29java_test(
30    name = "suspense",
31    test_class = "ijar.SuspendTest",
32    runtime_deps = [":SuspendTest"],
33)
34
35kt_jvm_library(
36    name = "inline",
37    srcs = [
38        "InlineCapture.kt",
39        "InlineInnerClass.kt",
40        "ReifiedInline.kt",
41    ],
42)
43
44# Compiling this file by itself triggers synthetic methods needed when compiling
45# dependants.  These methods carry annotations.
46kt_jvm_library(
47    name = "statics",
48    srcs = ["JvmStatics.kt"],
49)
50
51kt_jvm_library(
52    name = "main",
53    srcs = ["Main.kt"],
54    deps = [
55        ":inline",
56        ":statics",
57    ],
58)
59
60kt_jvm_library(
61    name = "inlined_suspense",
62    srcs = ["DoubleInline.kt"],
63)
64
65kt_jvm_library(
66    name = "SuspendTest",
67    srcs = ["SuspendTest.kt"],
68    deps = [
69        ":inlined_suspense",
70        "@maven//:com_google_truth_truth",
71        "@maven//:junit_junit",
72    ],
73)
74
75java_library(
76    name = "SamInJava",
77    srcs = ["SamInJava.java"],
78)
79
80kt_jvm_library(
81    name = "SamExt",
82    srcs = ["SamExt.kt"],
83    deps = [
84        ":SamInJava",
85    ],
86)
87
88kt_jvm_library(
89    name = "SamExtUser",
90    srcs = ["SamExtUser.kt"],
91    deps = [
92        ":SamExt",
93        ":SamInJava",
94    ],
95)
96
97java_test(
98    name = "inlinedSamExt",
99    main_class = "ijar.SamExtUserKt",
100    runtime_deps = [
101        ":SamExtUser",
102    ],
103)
104
105kt_jvm_library(
106    name = "InlineWhenMapping",
107    srcs = ["InlineWhenMapping.kt"],
108)
109
110kt_jvm_library(
111    name = "InlineWhenMappingUser",
112    srcs = ["InlineWhenMappingUser.kt"],
113    deps = [":InlineWhenMapping"],
114)
115
116java_test(
117    name = "inlineWhenMapping",
118    main_class = "ijar.InlineWhenMappingUserKt",
119    runtime_deps = [
120        ":InlineWhenMappingUser",
121    ],
122)
123