ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Amerige <Steve.Amer...@sas.com>
Subject Eclipse Debugging: Ant and Groovy
Date Wed, 25 Jan 2012 22:49:45 GMT
Hi all,

I have two files: *build.xml *and *doit.groovy *as shown below.  In Eclipse (Helios 3.6.2)
with Groovy-Eclipse plugins 
(2.6.1.xx.02120118-1300-e36-M1), I have a breakpoint set on the *println *in the *doit.groovy*.
 I do:

     build.xml > Debug As > Ant Build

But, the breakpoint is never hit and execution completes without stopping.  Can anyone figure
out how to get Eclipse to stop at the 
breakpoint in the groovy code?

By the way, I did read:

     http://www.vitorrodrigues.com/blog/2009/07/10/debugging-ant-tasks-in-eclipse/

to try to debug scriptdef (groovy) code, but the above doesn't work.

Enjoy,
Steve Amerige
SAS Institute, Deployment Software Development

*build.xml:*

    <?xml version="1.0" encoding="UTF-8"?>

    <project name="testTemplate" default="main" basedir=".">
    <taskdef resource="net/sf/antcontrib/antlib.xml"/>
    <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy"/>

    <target name="main">
    <antdoit>
    <echo message="inside antdoit"/>
    </antdoit>
    </target>

    <macrodef name="antdoit">
    <element name="body" implicit="true"/>
    <sequential>
    <antdoit-internal>
    <sequential>
    <body/>
    </sequential>
    </antdoit-internal>
    </sequential>
    </macrodef>

    <scriptdef name="antdoit-internal" id="doit" language="groovy" src="doit.groovy">
    <element name="sequential" classname="org.apache.tools.ant.taskdefs.Sequential"/>
    <![CDATA[
        groovydoit()
    ]]>
    </scriptdef>

    </project>


*doit.groovy:*

    import org.apache.tools.ant.Task

    def groovydoit()
    {
         Task body = (Task) elements.get("sequential").get(0)
         println body.dump() // breakpoint set here
    }


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message