【问题标题】:How to use cpp-tasks in Ant build如何在 Ant build 中使用 cpp-tasks
【发布时间】:2012-11-24 05:47:32
【问题描述】:

我正在使用 Ant 1.8.2,我收到此错误:

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.

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

问候。

【问题讨论】:

  • 有什么想法吗?我无法使用 Eclipse UI。
  • 能否请您包含您的构建文件等?
  • 请列出您的构建文件...以及您使用 ant-contrib 的原因。通常有比 ant-contrib 更好的方法。

标签: hibernate ant open-source ant-contrib


【解决方案1】:

你的类路径中没有 ant-contrib jar。 下载这个罐子。 并转到 Eclipse 中的窗口首选项。 select ant-runtime-(Ant Home Entries(Default)) 选择 添加外部罐子。在你的类路径中包含 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>

**

它会运行!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-11-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-15
    • 2013-01-12
    相关资源
    最近更新 更多