kotlin
kotlin copied to clipboard
Improve debugging capabilities
It's very hard to run debug locally which is very important.
Current caveats:
- Can't run it directly from IDE
- There is no possibility to pass additional parameters to
kotlinc
. I'm passing-J-agentlib:jdpwp...
to run a debug server -
in.json
must be extracted temp folder from regular non-debug run
My current script:
echo "" > out.json
DEBUG=true \
DANGER_GITLAB_HOST=... \
DANGER_GITLAB_API_TOKEN=... \
kotlinc -J-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:8001 -script-templates systems.danger.kts.DangerFileScript \
-cp /usr/local/lib/danger/danger-kotlin.jar \
-script Dangerfile.df.kts \
PATH_TO_MR \
in.json \
out.json
At least, the ability to pass additional kotlinc
parameters will make the debugging much easier
i'm investigating the possibility to add additional parameters to kotlinc if necessary, regarding running danger locally you can achieve that by using the command danger-kotlin pr {link to the pr} with DEBUG activated like:
DEBUG='*' danger-kotlin pr {LINK TO THE PR} --dangerfile /path/to/Dangerfile.df.kts