Ant4Eclipse例子 [英] Ant4Eclipse Examples
问题描述
我目前使用的标准Ant,我想移动到Ant4Eclipse(http://www.ant4eclipse.org/)取的,我的Eclipse项目已经建立并运行单元测试的类路径信息优势。
I'm currently using standard Ant and I want to move to Ant4Eclipse (http://www.ant4eclipse.org/) to take advantage of the classpath information that my eclipse project already has to build it and run unit tests.
问题我发现是我无法找到使用ant4eclipse构建一个简单的项目的一个很好的例子。我已经得到不同的结果要通过搜索并查看ant4eclipse文档。任何使用ant4eclipse建立一个Eclipse Java项目,或者一个网站来看看有很好的参考Ant文件?
Problem i'm finding is I can't find a good example of using ant4eclipse to build a simple project. I've been getting mixed results going through searches and looking at the ant4eclipse documentation. Anyone have a good reference ant file using ant4eclipse to build an Eclipse java project, or a site to look at?
谢谢!
推荐答案
所以,我想我只是误会一些任务的命名。我进口A4E-JDT-macros.xml(自带ant4eclipse),并用buildJdtProject宏观 - 超级好用
So I think I just misunderstood some of the naming of the tasks. I imported the a4e-jdt-macros.xml (comes with ant4eclipse), and used the "buildJdtProject" macro - super easy to use.
下面是一个例子:
<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>
这篇关于Ant4Eclipse例子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!