ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <>
Subject [Patch] Support for the groovy language with the ant <script> task
Date Tue, 03 Feb 2004 13:58:59 GMT

I have been looking at the groovy language:
and the <script> task.

The included patch will allow groovy to
be one of the supported languages for <script> allowing
the following:

    <script language="groovy"><![CDATA[
      z = <<<END
      this is a multi
      line string

      list = [1, 2, 3]
      map=["a":1, "b":2]
      println("a is " + map["a"])


printing out:

Declaring bean: g3 value: g3
Declaring bean: s2 value: s2
Declaring bean: self value:
Declaring bean: s5 value: s5
Declaring bean: project value:
Declaring bean: s4 value: s4
Declaring bean: b3 value: b3
Declaring bean: g value: g
Declaring bean: s3 value: s3
Declaring bean: b value: b
Declaring bean: basedir value: /home/preilly/learning/ant
Declaring bean: s value: s
      this is a multi
      line string
[1, 2, 3]
a is 1

(The "Declaring bean" prints are due to a printf  in groovy - 1.0.beta-3). (org.codehaus.groovy.bsf.GroovyEngine)

The patch are two changes: :       the Groovy language does not like "<ANT>" to be the name of the
                       changed to "ANT" (For some reason it attempts to make a class? for
the name).     Changed from "script <name>" to "script_name" : add groovy to the BSF supported languages (in the same way that beanshell
                                   to be added to BSF).

I would like to make the changes to ANT CVS and possiblely to the ant 1.6 branch.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message