File tree Expand file tree Collapse file tree 3 files changed +32
-7
lines changed
kotlin-analysis-api/testData
src/main/kotlin/com/google/devtools/ksp/processor Expand file tree Collapse file tree 3 files changed +32
-7
lines changed Original file line number Diff line number Diff line change 4
4
// (getX, setX), (getY, null)
5
5
// stringParameter
6
6
// stringParameter
7
+ // stringParameter
8
+ // JvmName: stringParameter
9
+ // JvmName: stringParameter
7
10
// END
8
11
// MODULE: lib
9
12
// FILE: Lib.kt
10
13
data class TestLibDataClass (var x : Int , val y : String )
11
- // FILE: MyAnnotation .kt
12
- annotation class MyAnnotation (
14
+ // FILE: MyAnnotationLib .kt
15
+ annotation class MyAnnotationLib (
13
16
@get:JvmName("stringParameter")
14
17
val stringParam : String
15
18
)
16
19
// FILE: MyAnnotationUserLib.java
17
- @MyAnnotation (stringParameter = " foo" )
20
+ @MyAnnotationLib (stringParameter = " foo" )
18
21
class MyAnnotationUserLib {}
19
22
20
23
// MODULE: main(lib)
24
+ // FILE: MyAnnotation.kt
25
+ annotation class MyAnnotation (
26
+ @get:JvmName("stringParameter")
27
+ val stringParam : String
28
+ )
21
29
// FILE: K.kt
22
30
data class TestDataClass (var x : Int , val y : String )
23
31
// FILE: MyAnnotationUser.java
32
+ @MyAnnotationLib(stringParameter = " foo" )
24
33
@MyAnnotation(stringParameter = " foo" )
25
34
class MyAnnotationUser {}
26
35
Original file line number Diff line number Diff line change @@ -25,11 +25,18 @@ class JvmNameProcessor : AbstractTestProcessor() {
25
25
}
26
26
listOf (" MyAnnotationUser" , " MyAnnotationUserLib" ).forEach { clsName ->
27
27
resolver.getClassDeclarationByName(clsName)!! .let { cls ->
28
- cls.annotations.single(). let { annotation ->
28
+ cls.annotations.forEach { annotation ->
29
29
results.add(annotation.arguments.joinToString { it.name!! .asString() })
30
30
}
31
31
}
32
32
}
33
+ listOf (" MyAnnotation" , " MyAnnotationLib" ).forEach { clsName ->
34
+ resolver.getClassDeclarationByName(clsName)!! .getAllProperties().forEach { p ->
35
+ p.getter?.let {
36
+ results.add(" JvmName: ${resolver.getJvmName(it)} " )
37
+ }
38
+ }
39
+ }
33
40
return emptyList()
34
41
}
35
42
}
Original file line number Diff line number Diff line change 4
4
// (getX, setX), (getY, null)
5
5
// stringParameter
6
6
// stringParameter
7
+ // stringParameter
8
+ // JvmName: stringParameter
9
+ // JvmName: stringParameter
7
10
// END
8
11
// MODULE: lib
9
12
// FILE: Lib.kt
10
13
data class TestLibDataClass (var x : Int , val y : String )
11
- // FILE: MyAnnotation .kt
12
- annotation class MyAnnotation (
14
+ // FILE: MyAnnotationLib .kt
15
+ annotation class MyAnnotationLib (
13
16
@get:JvmName("stringParameter")
14
17
val stringParam : String
15
18
)
16
19
// FILE: MyAnnotationUserLib.java
17
- @MyAnnotation (stringParameter = " foo" )
20
+ @MyAnnotationLib (stringParameter = " foo" )
18
21
class MyAnnotationUserLib {}
19
22
20
23
// MODULE: main(lib)
21
24
// FILE: K.kt
25
+ // FILE: MyAnnotation.kt
26
+ annotation class MyAnnotation (
27
+ @get:JvmName("stringParameter")
28
+ val stringParam : String
29
+ )
22
30
data class TestDataClass (var x : Int , val y : String )
23
31
// FILE: MyAnnotationUser.java
32
+ @MyAnnotationLib(stringParameter = " foo" )
24
33
@MyAnnotation(stringParameter = " foo" )
25
34
class MyAnnotationUser {}
26
35
You can’t perform that action at this time.
0 commit comments