2008-11-15 77 views

回答

1

要Ant脚本使用Groovy,你基本上要declare the Groovy ant task

<project name="groovy-build" default="listSourceFiles"> 

<taskdef name="groovy" 
    classname="org.codehaus.groovy.ant.Groovy"/> 
<groovy> 
    ant.... // some ant groovy directives 
</groovy> 
</target> 
</project> 

但是,你要小心,你的ant.xml,是指你的current target内文件集。

2

@VonC在您的Ant构建中包含Groovy脚本是正确的。

要扩展位:

编译.groovy.java来源一起使用在相同的应用,使用<groovyc> Ant任务。

查看Ant Integration with Groovy仅供参考。

0

你应该在groovyc里面定义javac,像这样。

<groovyc srcdir="${testSourceDirectory}" destdir="${testClassesDirectory}"> 
    <classpath> 
    <pathelement path="${mainClassesDirectory}"/> 
    <pathelement path="${testClassesDirectory}"/> 
    <path refid="testPath"/> 
    </classpath> 
    <javac source="1.4" target="1.4" debug="on" /> 
</groovyc> 

欲了解更多信息这里看看:http://groovy.codehaus.org/The+groovyc+Ant+Task在部分联合编制。

+0

诚然,感谢您的注意。 – 2013-08-28 20:36:22