ant

Using exec tag in Ant from Eclipse. How do I extend the PATH?

Hi, I am trying to exec git describe in ant from inside eclipse. I have the following inside one of my targets: <exec executable="git" outputproperty="git-desc"> <arg value="describe"/> </exec> When I try this from command line, ant runs properly as it uses the PATH set by my shell. When I try to run ant from eclipse, I get the ...

How can "if-else" logic be emulated using "condition"?

Hello, everyone! I know that there is ant-contrib, which provides "if-else" logic for ant. But I need to achieve the same without ant-contrib. Is that possible? Pseudocode which I need to work: if(property-"myProp"-is-true){ do-this; }else{ do-that; } Thank you! ...

How to link third party libraries in javadocs with Ant

I have a project that uses a third party library in the form of a jar file and I am using Ant to build the project javadocs. I can't get Ant to link to the third-party library javadocs when using the javadoc task. Here is the javadoc task: <javadoc excludepackagenames="" access="private" destdir="javadoc" author="true" vers...

Apache ant deleting directories no matter what

How do i get apache ant to delete a directory no matter what, even if there are locks or usages of the directory on windows. I am using a continuous integration remote agent on a windows box which fails to delete the build directory and as a result fails the builds which is extremely annoying and is disruptive to the statistics. There ...

use a style.css file from a .swc and build the Flex project with ANT

I have an .SWC library with a style.css file inside. The .SWC file is added to my project and the style.css is used this way: <fx:Style source="assets/style/style.css" /> If I want to build my project with an ANT-script it says that "the external stylesheet couldn't be found". In ANT you need to write the path for assets with an leadi...

ANT: Jdbc driver error

Trying the below code: <sql classpath="postgresql-8.4-701.jdbc3.jar" driver="org.database.jdbcDriver" url="devtest" userid="uid" password="pass"> select * from tab where tname = 'GR_DOCUMENT_PRINT_DFV'; </sql> Getting the below error: BUILD FAILED C:\Program Files\Java\apache-ant-1.8.1\build.xml:62: Class Not ...

How to configure lazy or incremental build in general with Ant?

Java compiler provides incremental build, so javac ant task as well. But most other processes don't. Considering build processes, they transform some set of files (source) into another set of files (target). I can distinct two cases here: Transformator cannot take a subset of source files, only the whole set. Here we can only make la...

How to add external jar libraries to an android project from the command line

I'm trying to build an Android project that has some dependencies. The jar files are in the lib/ directory. I can build the project by adding those jar file to my classpath, but of course it Force Closes in the emulator because those libraries aren't present. I'm doing this from the command line with ant (not in eclipse). How can I m...

Ant -lib not working

I'm trying to use the -lib option to specify a directory containing Ant tasks. But they're not loading. For example: $ ant -lib /path/to/libraries Buildfile: build.xml BUILD FAILED /path/build.xml:3: taskdef class com.oopsconsultancy.xmltask.ant.XmlTask cannot be found The build file contains: <project name="test"> <taskdef name="...

How can I install Apache Ant on Mac OS X ?

Hi guys, 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 ...

Using Ant date properties?

I am using Ant to build a fileset. I only want to include files in the file set that have been modified after a specific date. (See below) Ideally I would like the below datetime value to be some sort of property that is equal to the create date of the build file. E.g. I only want files included in the fileset that where modified after ...

Setting Ant project name without changing build file

We have a Java application and a supporting Ant build.xml file, and the team use the Eclipse IDE. I (and others) have the same application checked out several times, usually different branches. In the Eclipse "Ant" view, I get a list of the Ant projects, but they all have the same name - coming from the 'project' element of the Ant build...

ANT Execute failed: java.io.IOException: Cannot run program "cp ": java.io.IOException: error=2, No such file or directory

I'm trying to use ANT to copy files from one directory to another directory on Linux. Firstly I used copy task, it works fine but the file mode is not preserved. Then I changed to use , and that's where I got stuck. My target is like: <target name="test"> <echo message="${basedir}"/> <exec executable="cp " os="Linux" spawn="ye...

Netbeans project references on a build server

I'm trying to setup the following: a couple of Netbeans (6.9) projects (Java and Java EE) buildable on my own computer and on our daily build machine build files (classes and jars/wars/ears) should be outside the project directories to avoid Clearcase view-private files my machine is a Windows machine, build machine is Linux. On th...

Can't get svnant tasks to work with ant 1.7.1, svnant 1.2.1, java 1.6.0_17, and svnkit on windows xp

I'm trying to use svnkit to access subversion from the svnant ant tasks with the following result: BUILD FAILED /path/to/build.xml:49: Cannot find javahl, svnkit nor command line svn client at org.tigris.subversion.svnant.SvnTask.getClientAdapter(Unknown Source) at org.tigris.subversion.svnant.SvnTask.execute(Unknown Source) I...

How to specify multiple source folders in build.properties when using ant to build Android projects?

Apparently, I can specify source folders using the source.dir property in build.properties - but what if I want to specify multiple source folders ? The comments below are from the build.xml file generated by the Android SDK tools: <!-- The build.properties file can be created by you and is never touched by the 'android' tool. Thi...

Create and deploy environment-specific war builds for Tomcat during same build

I want to be able to build a war file and deploy it in multiple environments. I know I can create an ant task to get the environment and either include the files in the war, or replace the tokens as necessary. However, this would lead to as many different war files as environments (dev, QA, DR, prod, etc...). It seems that this would ...

Compile multiple flavors of the same Java software from Ant

I'm looking for a way to compile a few flavors of my Java software using Ant. By flavors I mean, for instance, trial and full version. In the code I have a public static final boolean TRIAL variable which specifies whether it is trial or full version. It would be very nice to be able to set it from Ant and to compile both versions ...

Can ANT expand environment variables from a properties file?

I have a question regarding ANT and its treatment of environment variables. To illustrate I have a small sample. Given the ANT file test.xml: <property environment="env"/> <target name="testProps"> <echo message="${env.MyEnvVar}"/> <echo message="${MY_PROPERTY}"/> </target> And the properties...

Compiling AIR application with Ant Task (WindowedApplication could not be found)

I'm trying to compile my AIR application with Ant, using the mxmlc Ant Task. It seems to compile fine, and I get a .swf, but when I try to run it with ADL, I get the message "Class mx.core::WindowedApplication could not be found." It looks like the AIR libraries aren't being included properly. Here's my mxmlc task: <mxmlc file="${...