2012-04-14 58 views

回答

1

香草蚂蚁通过在普通的ant.jar属性文件中定义了它的任务定义,你可以使用:

<project> 
<property url="jar:file:/path/to/your/ANT_HOME/ant.jar!/org/apache/tools/ant/taskdefs/defaults.properties" prefix="antcoretasks"/> 
<echoproperties prefix="antcoretasks"/> 
</project> 

列出蚂蚁核心任务,输出:

[echoproperties] #Ant properties 
[echoproperties] #Sat Apr 14 21:23:41 CEST 2012 
[echoproperties] antcoretasks.ant=org.apache.tools.ant.taskdefs.Ant 
[echoproperties] antcoretasks.antcall=org.apache.tools.ant.taskdefs.CallTarget 
[echoproperties] antcoretasks.antlr=org.apache.tools.ant.taskdefs.optional.ANTLR 
[echoproperties] antcoretasks.antstructure=org.apache.tools.ant.taskdefs.AntStructure 
[echoproperties] antcoretasks.antversion=org.apache.tools.ant.taskdefs.condition.AntVersion 
... etc. 

或将它们写入文件:

<echoproperties prefix="antcoretasks" destfile="some.file"/> 

如果还有其他要求,您必须在您的问题中提供更多详细信息。

+0

感谢您的回复。 – user1333579 2012-04-14 23:35:13

+0

也可以使用Groovy - AntBuilder()。antProject.taskDefinitions,但我更喜欢你的建议。谢谢 – user1333579 2012-04-14 23:36:16

+0

不知道,Groovy是你的选择。我喜欢Groovy,并经常在蚂蚁内外使用它。 – Rebse 2012-04-15 09:42:29

相关问题