On 13/12/09 8:08 PM, Roshan Dawrani wrote:
Hi,
I need to look into one groovy issue and for that I need to debug the groovyc process that is forked by gradle.

Could someone please let me know how to pass the compiler args in the gradle script to do the same?


Gradle uses Groovy's <groovyc> Ant task to do the compilation, and looking at the source of this task, it doesn't look like it offers any way to control the command-line args it uses to fork the groovyc process. For Gradle to do what you're asking, it would need the Ant task to support it first. Or for Gradle to drive Groovy's FileSystemCompiler directly (which we plan to do eventually).

Any chance you can debug this problem in non-forking mode? Then, you can use $GRADLE_OPTS to pass the debug command-line options:

GRADLE_OPTS=-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7777 gradle compileGroovy


I tried

compileTestGroovy.options.compilerArgs = [[value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7777"]]

(fails with "org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, [-FXrunjdwp:transport=dt_sockeress=7777] (The system cannot find the file specified)")

and

compileTestGroovy.options.compilerArgs = ["-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7777"]


compilerArgs are passed directly to javac, by which time it's too late for you to any useful debugging (I suspect).


--
Adam Murdoch
Gradle Developer
http://www.gradle.org


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to