我目前正在使用标准Ant,我想转到Ant4Eclipse (http://www.ant4eclipse.org/),以便利用我的eclipse项目已经拥有的类路径信息来构建它并运行单元测试。
我发现的问题是,我找不到一个使用ant4eclipse构建简单项目的好例子。通过搜索和查看ant4eclipse文档,我得到了各种不同的结果。谁有一个很好的参考ant文件使用ant4eclipse来构建一个Eclipse java项目,或者一个可以查看的站点?
谢谢!
发布于 2011-04-15 07:22:55
所以我想我只是误解了一些任务的命名。我导入了A4e-jdt-macs.xml(与ant4eclipse一起提供),并使用了"buildJdtProject“宏-超级易于使用。
下面是一个例子:
<project name="ant-in-eclipse" basedir="."
xmlns:ant4eclipse="antlib:org.ant4eclipse"
xmlns:antcontrib="antlib:net.sf.antcontrib">
<import file="a4e-jdt-macros.xml"/>
<target name="compileAndJar">
<buildJdtProject workspacedirectory="${workspace.dir}"
projectname="${proj.name}">
<finish>
<jar destfile="${jar.dir}/myjar.jar">
<ant4eclipse:jdtProjectFileSet
workspacedirectory="${workspace.dir}"
projectname="${buildJdtProject.project.name}"/>
</jar>
</finish>
</buildJdtProject>
</target>
</project>
https://stackoverflow.com/questions/5649348
复制相似问题