2012-12-06 106 views
4

我使用Ant 1.8.2,我得到这个错误:如何使用CPP-任务Ant构建

Cause: The name is undefined. 
Action: Check the spelling. 
Action: Check that any custom tasks/types have been declared. 
Action: Check that any <presetdef>/<macrodef> declarations have taken place. 

我GOOGLE了它。并意识到蚂蚁贡献缺失。之后,我添加了ant-contrib-1.0b3.jar。但是这个jar不支持Ant 1.8.2并且我不知道使用cpp-tasks。我读http://ant-contrib.sourceforge.net/cpptasks/index.html这个,但我没有克服。

问候。

+1

任何想法?我无法使用Eclipse UI。 –

+2

你可以请包括你的构建文件等? – imrichardcole

+0

请列出您的构建文件...以及您为什么使用ant-contrib。通常有更好的方法来做事情比ant-contrib。 – thekbb

回答

0

我在你的classpath中没有ant-contrib jar。 下载这个jar。 并转到日食中的窗口首选项。 select ant-runtime-(Ant Home Entries(默认))选择 添加外部罐子。在你的类路径中包含jar ant-contrib按下ok。

你的build.xml应该喜欢这个

<?xml version="1.0" encoding="UTF-8"?> 
     <project name="JarCreation" default="Jar" basedir="." xmlns:ac="antlib:net.sf.antcontrib"> 
     <property name="array" value="a,b,c,d"/> 
     <target name="Jar"> 
     <ac:for list="${array}" param="letter"> 
     <sequential> 
     <echo>Your Code Here</echo> 
     <ac:var name="test" value="somethin"/> 
     </sequential> 
     </ac:for> 
     </target> 
     </project> 

**

它会跑!