ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conelly, Luis (GNF, Contractor)" <>
Subject RE: Can build failure set a property??
Date Wed, 03 Mar 2004 13:31:47 GMT
You can use ant-contrib[1] <trycatch> task

        <!--whatever you want to do here-->
        <!--handling error-->
        <!--closing code-->



-----Original Message-----
From: Sreejith.M.Janardhanan []
Sent: Wednesday, March 03, 2004 2:54 AM
To: Ant Users List
Subject: Can build failure set a property??


	We have a build file in our project which calls another build
file in the build process. Is there any property which can say that
build 2 has failed??
For example, if the following is the target in build1 file, then what is
the property that shall indicate failure instead of

    <target name="build">
	<echo message="Starting to make build" />
	<!-- Login to CVS -->
	<cvs command="login"
	<!-- Get the latest from CVS -->
	<cvs command="up -d -P" />
	<!-- Call the target that does everything -->
	<ant antfile="build2.xml" target="dist"/>

    <!-Has the build failed ?? -->
    <target name="checkbuild" if="${whatfailureproperty}"
	<echo message="Build failure!!"/>

I searched on the web for failure of builds but all were related to
junit test case failure or something like that. 
Can somebody provide me with an insight on how this can be done??

Sreejith M Janardhanan
Cordys R&D (India) Pvt Ltd,
Vanenburg IT Park,
P.O Cyberabad, Hyderabad, India - 500081

The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this message
by anyone else is unauthorized. If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message