What is the simplest way to debug a kotlin annotat...
# kapt
a
What is the simplest way to debug a kotlin annotation processor?
e
g
Arpan probably asking about third party AP, right? You can do that s by debugging Gradle build
a
I have added
kapt.use.worker.api=true
in my `gradle.properties`and using this command to attach the remote debugger`./gradlew --no-daemon -Dorg.gradle.debug=true -Dkotlin.daemon.jvm.options="-Xdebug,-Xrunjdwp:transport=dt_socket\,address=5005\,server=y\,suspend=n" :clean assemble` , it waits for the debugger to be attached. but apparently what is happening when i am attaching the debugger the gradle is building successfully and generating the source files using the annotation processor. But most of the time the breakpoints is not getting triggered even if i place it in
init()
of the annotation processor.
g
Not sure about worker api flag, I believe I always used to debug without it, but it had another problem, required to attach debugger when kotlin daemon is start building (so essentially during kapt task execution)