Closed vs49688 closed 7 years ago
I would recommend to use "--debug-jvm" as a parameter on exection for the netbeans debug task as you don't need to touch the build gradle to debug.
Like
gradle someJavaExecTask --debug-jvm
See https://docs.gradle.org/current/dsl/org.gradle.api.tasks.JavaExec.html
You don't need to touch the build scripts if you already have a JavaExec task. You just have to configure the Debug task in Project Properties/Built-in Tasks. That is, here you have to change the name of "run" (or "debug" depending on your debug mode). I recommend to set the debug mode to "Debugger listens for connection" globally (then change these settings).
Ahh, I didn't even think of changing the built-in tasks -- That worked nicely. Thanks. My suggestion was that the debugger auto-attach if it detects a JVM being started in debug mode -- it's a minor QoL thing, but it's easy enough to add a profile and change the tasks.
I've a few custom tasks that start the JVM in debug mode (see below). It'd be nice if the debugger auto-launched and attached to these tasks.
Does something like this exist? If not, I'll take a crack at it sometime tomorrow. I'm thinking adding it as another checkbox in the "Custom Tasks" menu.