ant

How to fail Ant build if errors are detected in either of two files?

I am using Ant to do a database build by basically using the exec task to run some SQL scripts. However, there might be errors generated during the script execution (e.g. could not properly drop a connected user, etc) so I check for this by looking through two output log files. Here's a snippet of the relevant target: <target name="bu...

How to suppress ant jar warnings for duplicates

I don't want ant's jar task to notify me every time it skips a file because the file has already been added. I get reams of this: [jar] xml/dir1/dir2.dtd already added, skipping Is there a way to turn this warning off? ...

Best location for ant build.xml files?

For those of you that use Ant with multiple projects, where do you put the build.xml files? Do you put one in each project, or do you put them in a separate project that contains all your Ant-related files? The usual recommendation is to put a build.xml in each project. But this has a few drawbacks: It makes it hard to reuse common ta...

How to use Ant tar task and preserve file permissions?

Of course it can be done using exec task, but my question is: Is it possible to do it with tar task? ...

How can I stop a Cruise Control build or change the config to cause long running builds to time out?

Is there any way to stop an active Cruise Control build short of stopping and restarting Cruise Control? I'm running Cruise Control Dashboard version 2.7.2. If there is no way to stop an active build, how can I cause long running builds to timeout? Is this something I should configure in Cruise Control or in Ant? Background It looks l...

How to pass xml text as argument in exec ant task?

We need to call an executable from ant that takes xml as part of the argument. Using exec is easy enough, but one of the arguments includes an xml file. We tried loading the xml file using the loadfile target with striplinebreaks <loadfile property="xmlStuff" srcFile="xmlFile.xml"> <filterchain> <striplinebrea...

Ant Bulk Search and Replace

I have a properties file in which the keys represent strings in source code files that I would like to search for, and the values represent the replacement string that I would like to replace the strings with (see below for an example). I would like to perform these replacements over a set of files during my Ant build, however I cant se...

Ant Property containing Macrodef Parameters

Is there a way to put a value in a property that contains a macrodef parameter string? For example, in the following macrodef I would like to add the ${build.dir}/widget/@{platform}/@{resolution}/${widget.name} to a property as it is used in several macrodefs. <macrodef name="setBuildstamp"> <attribute name="platform" /> <att...

How can I build PDF LaTeX documents with ANT (or some other build system if you prefer)?

The team I work for manages a large collection of technical documentation which is written in LaTeX. Currently all the documentation we have is manually built by the editors and then checked into a version control system. Sometimes people forget to compile their documents so we have a situation where the PDF and .tex files are often ou...

per-file dependencies in ant

I have a set of input files, each of which is processed to generate an output file. In one case it's hibernate xml files as input, and java files as output, but that isn't the only case I have to deal with. In make, I would have set up a rule to tell it how to generate a .java file from an .hbm.xml file (modulo the .hbm.xml specifying ...

Running FlexUnit4 tests in Hudson with ant

I'm just starting to try figure out how to go about continuous integration and test driven development, specifically in Flex 4. I'd like to run FlexUnit4 tests from an ant script initiated in Hudson. I can get hudson to compile my app but how do I then go about running/seeing results of my tests? ...

Documentation with Doxia + Ant

I would like to use Doxia to generate some documentation but invoke it with Ant (and no, Maven is not an option). I was looking for some pointers but nothing popped up after a few Google search. Did anyone already used Doxia in an Ant environment and how did it turned out? ...

groovy ant task

Hi, I'm using the groovy ant task to compile my groovy files, but it seems like groovy locks the jar file so it can't be moved, deleted, signed, etc. Has anyone run into this bug before and have a workaround? Seems weird that if I run the groovy ant task and compile to a jar file that groovy doesn't release that jar file. thanks, Jeff...

compiling SQLJ with Ant

How to compile SQLJ with ant? ...

Eclipse: how to run plugin test as part of local build

Hello! Due to incomplete understanding of eclipse infrastructure I have one problem. Historically we have one ugly thing in our build procedure. It looks like following: After eclipse builds entire workspace there is one incomplete thing in local build of plugins. It is some data file which is currently built during execution of special ...

onerror parameter in ant <taskdef>/<typedef> in antlib descriptor.

I am creating an antlib with custom tasks to be used in our build system. I have looked at antcontrib antlib declaration and noticed that the typedefs/taskdefs have onerror parameter set to ignore, e.g. <taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" onerror="ignore"/> The default value of the onerror para...

Is it possible to use a Dynamic xPath expression in a xslt style sheet?

I'd like to use the value of an xslt parameter in an xpath expression. Specifically, as part of a not() call in an <xsl:if expression. <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; <!-- my_param contains a string '/foo/bar', passed in from ant --> <!-- the 'no' is just a default value --> <xsl:par...

Respond to shell prompts from Ant SSH task (SSHEXEC)

I'm using the SSHEXEC ant task to run an SSH script against a remote linux box. This has worked fine until I try and call a ksh script which prompts the user for input. The script changes the current user (like su). It prompts the user for a change_request_id, and a change_request_reason. So using this command normally in a shell wou...

How to call WSDL2JAVA from ant with whitespaces in my path

HI guys! I try to call Axis2 WSDL2JAVA in my ant file to create a WSDL client. But it's broken because I have whitespaces in my path (I'm on Windows...). This is my ant <property name="wsdl.file" location="C:\path with whitespaces\project\subdir\my.wsdl"/> ... <target name="generate.client" depends="Clean.Client"> <java classname=...

How to turn directories to .jar files with Ant

Hi All ! How to turn a list of directories into a list of .jar files ? It seems that using Copy Task and Mappers is the right way to do this but I did not find any nested element creating a jar file from a directory. Of course, the list of directories would be computed and not hard coded in the ant script. For instance, a foo director...