ant 1.6.1 から Groovy を呼び出す

ant 1.6.0 では動かない。

 >set ANT_HOME=apache-ant-1.6.0
 >type build.xml
 <?xml version="1.0" encoding="UTF-8"?>
 <project default="groovy" name="groovy" basedir=".">
   <target name="groovy">
     <script language="groovy"><![CDATA[
        println "Hello Groovy!!!"
        [0, 1, 2].each { println it }
     ]]></script>
   </target>
 </project>
 >ant
 BUILD FAILED
 E:\temp\build.xml:4: org.apache.bsf.BSFException: unsupported language: groovy

ant 1.6.1 では動く。
必要な jarを %GROOVY_HOME%\lib から %ANT_HOME%\lib にいれる。

  • asm-1.4.1.jar
  • groovy-1.0-beta-3.jar
  • bsf-2.3.0-rc1.jar
 >set ANT_HOME=apache-ant-1.6.1
 >ant
    [script] Hello Groovy!!!
    [script] 0
    [script] 1
    [script] 2