xref: /aosp_15_r20/external/ksp/test-utils/testData/api/getPackage.kt (revision af87fb4bb8e3042070d2a054e912924f599b22b7)
1 /*
2  * Copyright 2021 Google LLC
3  * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 // TEST PROCESSOR: GetPackageProcessor
19 // EXPECTED:
20 // symbols from package lib1
21 // lib1.FooInSource KOTLIN
22 // lib1.propInSource KOTLIN
23 // lib1.Bar JAVA_LIB
24 // lib1.Foo KOTLIN_LIB
25 // lib1.funcFoo KOTLIN_LIB
26 // symbols from package lib2
27 // lib2.Foo KOTLIN_LIB
28 // lib2.a KOTLIN_LIB
29 // symbols from package main.test
30 // main.test.KotlinMain KOTLIN
31 // main.test.C JAVA
32 // main.test.D JAVA
33 // END
34 
35 // MODULE: lib1
36 // FILE: foo.kt
37 package lib1
38 
39 class Foo
40 
funcFoonull41 fun funcFoo(): Int {
42     return 1
43 }
44 
45 // FILE: Bar.java
46 package lib1;
47 
48 class Bar {}
49 
50 // MODULE: lib2
51 // FILE: foo.kt
52 package lib2
53 
54 class Foo
55 
56 val a = 0
57 
58 // FILE: Bar.java
59 
60 class Bar {}
61 
62 // MODULE: main(lib1, lib2)
63 // FILE: a.kt
64 package lib1
65 class FooInSource
66 
67 val propInSource = 1
68 // FILE: main.kt
69 package main.test
70 
71 class KotlinMain
72 
73 // FILE: main/test/C.java
74 package main.test;
75 
76 public class C {
77 
78 }
79 
80 class D {
81 
82 }
83 
84 // FILE: wrongDir/K.java
85 package main;
86 
87 public class K {
88 
89 }
90 
91 class KK {}
92 
93 
94 // FILE: main/test/main/test/L.java
95 package main.test;
96 
97 public class L {
98 
99 }
100