ant

Ivy not installing some JARs

回眸只為那壹抹淺笑 提交于 2019-12-30 05:44:09
问题 I'm using Ivy for project dependency management and it's been working well aside from one issue which I've always had. There are certain dependencies that Ivy is downloading but it's not installing them into my project. For example, log4j.jar is not being put in the project's lib folder even though it's listed as a dependency and is being downloaded successfully. Here's the output from my resolve: ivy-resolve: [ivy:configure] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ :: [ivy

Exposing inner classes when obfuscating with ProGuard

折月煮酒 提交于 2019-12-30 04:38:13
问题 I'm obfuscating a library with ProGuard using the Ant task. I'm keeping particular class names and their method names when they have a particular annotation (@ApiAll) and I'm requesting that the InnerClasses attribute be kept: <keepattribute name="InnerClasses" /> <keep annotation="com.example.ApiAll"/> <keepclassmembers annotation="com.example.ApiAll"> <constructor access="public protected"/> <field access="public protected"/> <method access="public protected"/> <constructor access=

How to include an external jar lib in my Ant build

对着背影说爱祢 提交于 2019-12-30 04:19:41
问题 I have the following build.xml : <project> <target name="clean"> <delete dir="./build"/> </target> <target name="compile"> <mkdir dir="./build/classes"/> <javac srcdir="./src" destdir="./build/classes"/> </target> <target name="jar"> <mkdir dir="./build/jar"/> <jar destfile="./build/jar/DependencyFinder.jar" basedir="./build/classes"> <manifest> <attribute name="DependencyFinder" value="main"/> </manifest> </jar> </target> <target name="run"> <java jar="./build/jar/DependencyFinder.jar"

How to include an external jar lib in my Ant build

陌路散爱 提交于 2019-12-30 04:19:01
问题 I have the following build.xml : <project> <target name="clean"> <delete dir="./build"/> </target> <target name="compile"> <mkdir dir="./build/classes"/> <javac srcdir="./src" destdir="./build/classes"/> </target> <target name="jar"> <mkdir dir="./build/jar"/> <jar destfile="./build/jar/DependencyFinder.jar" basedir="./build/classes"> <manifest> <attribute name="DependencyFinder" value="main"/> </manifest> </jar> </target> <target name="run"> <java jar="./build/jar/DependencyFinder.jar"

Converting an Ant fileset to multiple apply args

我的梦境 提交于 2019-12-30 03:03:06
问题 I have some files: dir/foo.txt dir/bar.txt dir/foobar.txt In an Ant apply task, I want to pass the list of files as arguments: <target name="atask"> <apply executable="${cmd}" parallel="false" verbose="true"> <arg value="-in"/> <srcfile/> <arg value="dir/foo.txt"/> <arg value="dir/bar.txt"/> <arg value="dir/foobar.txt"/> <fileset dir="${list.dir}" includes="*.list"/> </apply> </target> This works fine, but what if I want to pick the list of files dynamically, using a fileset: <fileset dir=

Ant: copy the same fileset to multiple places

五迷三道 提交于 2019-12-30 01:36:14
问题 I need an Ant script that will copy one folder to several other places. As a good obedient programmer, I want not to repeat myself. Is there any way of taking a fileset like this: <copy todir="${target}/path/to/target/1"> <fileset dir="${src}"> <exclude name='**/*svn' /> </fileset> </copy> And storing the fileset in a variable so it can be re-used? 回答1: Declare an id attribute on the fileset and then reference it in each copy task. For example: <project name="foo"> <fileset id="myFileSet" dir

Ant的总结

与世无争的帅哥 提交于 2019-12-29 22:35:35
一、认识Ant 1.Ant是与GNU make工具相似的一种java构建工具 2.使用java编写,开放源代码 Apache Ant,是一个将软件编译、测试、部署等步骤联系在一起加以自动化的一个工具,大多用于 Java 环境中的软件开发。由Apache软件基金会所提供.Ant 也可以有效地用于构建非Java应用程序,例如 C 或 C++ 的应用程序。更一般地,Ant 可以用来驾驶任何类型的能在目标和任务来描述过程。 二、Ant的特点总结 ant 有以下的优点: 1、跨平台性:Ant是纯Java语言编写的,所以具有很好的跨平台性。 2、操作简单:Ant是由一个内置任务和可选任务组成的,用ant任务就像是在dos中写命令行一样。Ant运行时需要一个XML文件(构建文件)。 Ant通过调用target树,就可以执行各种task。每个task实现了特定接口对象。 3、维护简单、可读性好、集成简单:由于Ant构建文件 时XML格式的文件,所以很容易维护和书写,而且结构很清晰。Ant可以集成到开发环境中。由于Ant的跨平台性和操作简单的特点,它很容易集成到一些开发环境中去。 三、Ant命令总结 -projecthelp 显示包含在构建文件中的、所有用户编写的帮助文档。即为各个中description 属性的文本,以及包含在元素中的任何文本。将有description 属性的目标列为主目标

is there a way to set ant -verbose inside build.xml?

白昼怎懂夜的黑 提交于 2019-12-29 18:50:31
问题 I would like to get verbose console output while building from eclipse and hudson. There seems to be no verbose property for <target> and <project> and it seems very wrong to call <exec> on ant from inside the script just to pass the verbose prop. Is there a better way? 回答1: It will be an eclipse External Tools Configuration parameter (under Run -> External Tools ). Please see the screenshot below: 回答2: You could use Ant's <record> task (http://ant.apache.org/manual/Tasks/recorder.html) to

How can I install Apache Ant on Mac OS X?

时间秒杀一切 提交于 2019-12-29 10:03:59
问题 I tried to install Apache Ant on my Mac and I followed the next steps : I downloaded apache-ant-1.8.1-bin.tar.gz into my Downloads folder. I moved the file to /usr/local/ using this commands : sudo sh and mv apache-ant-1.8.1-bin.tar.gz /usr/local/ Now I want to use cd /usr/local/ but it's not working, I get back "No such file or directory". Then I used cd /usr/ and ls commands and it seems that the local folder is there. If I try to access it I get the same error. Since I already used sudo su

Adding Builders to Project in Eclipse and Incremental-ness

情到浓时终转凉″ 提交于 2019-12-29 08:34:28
问题 I have a Java project, with the standard Java Builder selected as it's sole builder. Also, the build is configured to build automatically. What I would like to understand is the resulting build circumstances when I add an ant build to this project ( project -> properties -> builders ). What I would expect, is that everytime I make a change to my Java source, both the Java Builder and my ant build will run, but it doesn't seem that my ant build runs. When I first add the ant build, it runs, i