ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <>
Subject Re: Persistence of properties between ant targets
Date Tue, 24 Oct 2006 11:13:09 GMT
On 10/24/06, Adam Downer <> wrote:
> Hi,
> I have a build file with a target which runs the standard JUnit task.
> This task sets a property (using errorproperty & failureproperty
> attributes) if any of the tests do not pass.
> The target containing the JUnit task is called, using antcall, by a
> separate, higher level target. Hopefully this makes sense so far.
> The idea being that I run the JUnits and the property is only set is
> something is wrong. Further antcalls in the higher level target have the
> unless attribute defined in order to stop them from executing if the
> tests do not pass and finally fail the build with the appropriate
> message (using a <fail>). However, the properties are being set
> correctly in the JUnit target but are not being maintained beyond that
> target so when the other targets invoke the unless attribute, the
> property does not exist and the targets run and the build is successful.
> I am slightly stumped as to how I can get this to work the way I want
> it. Normally I would define the property in the high level target and
> then use it when it is needed, but the unless clause checks if the
> property exists, not its value, so this won't work for me (apart from if
> I am missing something).
> Does anyone know a way around this?

Each antcall sets up a new project with it's own copy
of properties - so setting them in the new project has
no impact on the calling project.

Instead of using a target you could use a <macrodef> to
define the junit call.

Alternativley you could use the ant-contrib antcallback


> Thanks in advance
> Adam Downer
> This communication contains information which is confidential and is for the exclusive
use of the addressee.  Any unauthorised use, distribution or copying of the information is
prohibited.  If you have received this transmission in error please contact the sender immediately.
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit
> ______________________________________________________________________

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message