ant

How can I terminate a process started from an Ant task if the script is cancelled?

I've created an Ant task to compile VB6 applications. After some preprocessing of the source files, I start VB6.exe with the appropriate parameters using Process p = Runtime.getRuntime().exec(...); p.waitFor(); But when I press Ctrl+C while Ant is running, the script and my task are terminated but the spawned process is still runnin...

create a war file

I want to create a war file for project. The code works fine for creating jar file. when I run the following ant build.xml it still gives the message jar file BUILD SUCCESSFULL. <project name="struts-spring" basedir="../" default="all"> <!-- Project settings --> <property name="project.title" value="Sufalam Struts 2 Tutorials"/>...

How do you "refactor" ant build.xml files ?

I'm working on a large C++ system built with ant+cpptasks. It works well enough, but the build.xml file is getting out of hand, due to standard operating procedure for adding a new library or executable target being to copy-and-paste another lib/exe's rules (which are already quite large). If this was "proper code", it'd be screaming o...

How do I use TestNG with Apache Ivy?

I tried to use TestNG with Apache Ivy, but was unsuccessful. Here is my ivy.xml: <ivy-module version="2.0"> <info organisation="me" module="myproject"/> <dependencies> <dependency org="org.testng" name="testng" rev="5.8" /> </dependencies> </ivy-module> This fails to actually download a TestNG jarfile. It seems to...

How do you configure Apache Ivy to remove orphan artifacts?

Let's say I have an ivy.xml that contains the following: <dependency org="checkstyle" name="checkstyle" rev="4.3" /> And then I want to upgrade to Checkstyle 4.4, so I change my ivy.xml to contain: <dependency org="checkstyle" name="checkstyle" rev="4.4" /> After a retrieve with the first configuration, I have the file checksty...

Compiling flex modules into swf with other mxml files in ant

I have a huge project with many mxml and as files and am trying to compile them all into one working swf file using ant. However, I'm having trouble compiling main.swf correctly in ant. It doesn't seem to be pulling in the necessary modules, all of which are located in separate folders within the main src folder. It will compile with...

How do I view Ant scripts that eclipse uses?

I am having a bit of trouble building my project with Ant. I wanted to take a look at the Ant scripts that eclipse uses to build my project. How can I do this? ...

How do I apply targets to a sublist of projects in Ant?

I have a bunch of sub projects in various directories. I want to specify them as a list, then for a given target I want to go through each one, one-by-one and call subant. I've got something like: <target name="run"> <subant target="run" failonerror="true" verbose="true"> <fileset dir="${projectA}" includes="build.xml"/> ...

ant task to copy properties file to their corresponding place in the java build dir

OK, I'm stumped. I have a Java tree that looks like a fairly typical Eclipse Java build: myproject src com example test // Java files in com.example.test here bin com example test // Compiled class files will go here Now I have a MyClass.properties file in myproject/src/com/...

Output of java task in Ant

I have a .java file and am compiling it using javac in ant. The .class file goes to output directory. A.class when ran, produces a.txt. How to run the ant ´java´ task and where will the a.txt go, when ran? I mean which directory? Can I specify the direc. where the output files of java task should go? ...

Filtering Files In-Place with Ant?

I have a directory of files for which I'd like to do "in-place" string filtering using Apache Ant (version 1.7.1 on Linux). For example, suppose that in directory mydir I have files foo, bar, and baz. Further suppose that all occurences of the regular expression OLD([0-9]) should be changed to NEW\1, e.g. OLD2 NEW2. (Note that the rep...

Is there a way to make an ANT task run as Administrator in Windows Vista?

As part of an installer, I need to run a batch file from ANT. If I run cmd.exe as Administrator and run the batch file, all is well since it has the appropriate administrative privileges. When the batch file is executed from ant, it fails, the same way it does if I were to run the batch file without administrative privileges. My question...

Flex, Ant and TeamCity

Is anyone using TeamCity for building their Flex apps? We're using .Net for our main site code and backend flex data calls and we use flex for our application. I have a working Ant build script, but I can't get it to run with the TeamCity Ant Runner. I'm curious if anyone has gotten this working and if they have, could I potentitially se...

ant: list folders on command line

I'm new to ant. I'm looking to a way to do this I have a folder, with a variable number of subfolders. Suppose subfolders are s1,s2,s3...,sN (N is not known) I need to create and execute this command line java -jar myjar.jar s1\ s2\ s3\ ... sN\ I would like to use standard task, but I do not know how to list folders on the command l...

Faster javac/ant?

I find java starts up and runs practically instantly for me - but javac takes a few seconds, and ant makes it slower again. It's only a few seconds, but my edit-compile-test loop would be smoother without it. :-) BTW: I've already used vim's ":make" with ant. Is there a way to speed up javac and/or ant? I'm thinking of special switc...

Signing a jar with WTK via ant task

Is there a way to sign an Jar for a JavaMe / j2me aplicattion, using Sun WTK via an ant task? examples, or tutorials links would be appreciated. ...

How can I strip a substring from a string with a regular expression?

Hi, I have a classpath, something like: myproject/classes;myproject/lib/somecrab.zip;myproject/lib/somelib1.jar;myproject/lib/somelib2.jar;myproject/lib/somelib3.jar; Now I would like to clean up this classpath and throw away somethings which I don't want anymore. Hence in this case the classpath should look something like myproject/...

Working example to start canoo webtest from Groovy?

I would like to start a simple webtest from Groovy with Canoo. The example Canoo Example is not working. I think I am missing something with the Antbuilder class. Especially the "config" part, where a HashMap of properties is passed. I have tried different ways to pass properties but my most basic approach: config_map = ['host':'www.goo...

ant compile doesn't copy the resources

Hello, I created my own build.xml which got: <target name="compile"> <mkdir dir="build"/> <javac destdir="build"> <src path="src"/> </javac> </target> <target name="build" depends="compile"> <mkdir dir="dist"/> <jar destfile="dist/app.jar" basedir="build" /> </target> <target name="run" depends="compile"> ...

Can JUnit Ant task report ignored tests?

We're currently using JUnit 4.4 and Ant 1.7.1 for our builds. I have some test cases that are @Ignored. When I run them in Eclipse, the JUnit test runner reports them as ignored. I would like to see them listed in the XML output from Ant (so I can report on them), but they do not seem to be there. Does anyone have this working? Is ther...