I have been unable to use a GradelScriptRunner using the tooling api and the IntelliJ debugger. I can use breakpoints in the GradelScriptRunner but no breakpoints inside the main application are recognized. Is this because of the way the tooling API launches the jettyRun task in a daemon process which prevents Intellij attach to to process (im guessing here how this works)? I double checked that the compiled code contains debug metadata, any suggestions?
class GradleScriptRunner {
public static void main(String[] args) {
ProjectConnection connection = GradleConnector.newConnector()
.forProjectDirectory(new File("."))
.connect()
try {
connection.newBuild()
.forTasks("jettyRun")
.withArguments("-b", "webapp.gradle")
.setJvmArguments("-Xmx1024m", "-XX:MaxPermSize=256m", "-Dtapestry.execution-mode=DevelopmentMode")
.run()
} finally {
connection.close();
}
}
}