Aspectj doesn't work with kotlin

后端 未结 5 1440
南方客
南方客 2020-12-29 08:41

i want to use aspectj aop in kotlin,here is my code:

my annotation in annotation.lazy_list:

Kotlin:

 package anotation

@Retention(Annotation         


        
5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-29 09:23

    For annotation process in Kotlin, you must enable and use KAPT. Without this being added via Gradle or Maven plugin, nothing is going to work for annotation processing in Kotlin code.

    The Kotlin plugin supports annotation processors like Dagger or DBFlow. In order for them to work with Kotlin classes, apply the kotlin-kapt plugin.

    See also:

    • Pushing the limits of Kotlin annotation processing
    • kapt: Annotation Processing for Kotlin
    • Better Annotation Processing: Supporting Stubs in kapt

提交回复
热议问题