我目前正在使用标准 Ant,我想转移到 Ant4Eclipse (http://www.ant4eclipse.org/) 以利用我的 eclipse 项目已经拥有的类路径信息来构建它并运行单元测试。
我发现的问题是我找不到使用 ant4eclipse 构建简单项目的好例子。我通过搜索和查看 ant4eclipse 文档得到了不同的结果。有人有一个很好的参考 ant 文件,使用 ant4eclipse 构建 Eclipse java 项目,或者可以查看的网站吗?
Thanks!
所以我想我只是误解了一些任务的命名。我导入了 a4e-jdt-macros.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>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)