File tree Expand file tree Collapse file tree
kotlin-analysis-api/testData
src/main/kotlin/com/google/devtools/ksp/processor Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44// (getX, setX), (getY, null)
55// stringParameter
66// stringParameter
7+ // stringParameter
8+ // JvmName: stringParameter
9+ // JvmName: stringParameter
710// END
811// MODULE: lib
912// FILE: Lib.kt
1013data class TestLibDataClass (var x : Int , val y : String )
11- // FILE: MyAnnotation .kt
12- annotation class MyAnnotation (
14+ // FILE: MyAnnotationLib .kt
15+ annotation class MyAnnotationLib (
1316 @get:JvmName("stringParameter")
1417 val stringParam : String
1518)
1619// FILE: MyAnnotationUserLib.java
17- @MyAnnotation (stringParameter = " foo" )
20+ @MyAnnotationLib (stringParameter = " foo" )
1821class MyAnnotationUserLib {}
1922
2023// MODULE: main(lib)
24+ // FILE: MyAnnotation.kt
25+ annotation class MyAnnotation (
26+ @get:JvmName("stringParameter")
27+ val stringParam : String
28+ )
2129// FILE: K.kt
2230data class TestDataClass (var x : Int , val y : String )
2331// FILE: MyAnnotationUser.java
32+ @MyAnnotationLib(stringParameter = " foo" )
2433@MyAnnotation(stringParameter = " foo" )
2534class MyAnnotationUser {}
2635
Original file line number Diff line number Diff line change @@ -25,11 +25,18 @@ class JvmNameProcessor : AbstractTestProcessor() {
2525 }
2626 listOf (" MyAnnotationUser" , " MyAnnotationUserLib" ).forEach { clsName ->
2727 resolver.getClassDeclarationByName(clsName)!! .let { cls ->
28- cls.annotations.single(). let { annotation ->
28+ cls.annotations.forEach { annotation ->
2929 results.add(annotation.arguments.joinToString { it.name!! .asString() })
3030 }
3131 }
3232 }
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+ }
3340 return emptyList()
3441 }
3542}
Original file line number Diff line number Diff line change 44// (getX, setX), (getY, null)
55// stringParameter
66// stringParameter
7+ // stringParameter
8+ // JvmName: stringParameter
9+ // JvmName: stringParameter
710// END
811// MODULE: lib
912// FILE: Lib.kt
1013data class TestLibDataClass (var x : Int , val y : String )
11- // FILE: MyAnnotation .kt
12- annotation class MyAnnotation (
14+ // FILE: MyAnnotationLib .kt
15+ annotation class MyAnnotationLib (
1316 @get:JvmName("stringParameter")
1417 val stringParam : String
1518)
1619// FILE: MyAnnotationUserLib.java
17- @MyAnnotation (stringParameter = " foo" )
20+ @MyAnnotationLib (stringParameter = " foo" )
1821class MyAnnotationUserLib {}
1922
2023// MODULE: main(lib)
2124// FILE: K.kt
25+ // FILE: MyAnnotation.kt
26+ annotation class MyAnnotation (
27+ @get:JvmName("stringParameter")
28+ val stringParam : String
29+ )
2230data class TestDataClass (var x : Int , val y : String )
2331// FILE: MyAnnotationUser.java
32+ @MyAnnotationLib(stringParameter = " foo" )
2433@MyAnnotation(stringParameter = " foo" )
2534class MyAnnotationUser {}
2635
You can’t perform that action at this time.
0 commit comments