Skip to content
This repository has been archived by the owner on Dec 20, 2022. It is now read-only.

How to debug Kotlin Compiler Plugin

Jens Klingenberg edited this page Sep 1, 2019 · 2 revisions

Kotlin Native

  • Add this to your gradle.properties file: kotlin.native.jvmArgs=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5006

  • Create a Remote Run Configuration and add: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5006

to the "Command line arguments for remote JVM"

  • Run build and wait till the server started ./gradlew build

  • Now select your remote run configuration and start it in debug mode. The debugger should now stop at your breakpoints.

Kotlin JVM/JS

  • Create a Remote Run Configuration and add: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 to the "Command line arguments for remote JVM"

  • Run build with the following arguments ./gradlew build --no-daemon -Dorg.gradle.debug=true -Dkotlin.compiler.execution.strategy="in-process" -Dkotlin.daemon.jvm.options="-Xdebug,-Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n"
  • Now select your remote run configuration and start it in debug mode. The debugger should now stop at your breakpoints.