ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conelly, Luis (GNF, Contractor)" <Luis.Cone...@gnf.com>
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

<trycatch>
    <try>
        <!--whatever you want to do here-->
    </try>
    <catch>
        <!--handling error-->
    </catch>
    <finally>
        <!--closing code-->
    </finally>
</trycatch>

HTH
Luis

[1] http://ant-contrib.sourceforge.net/

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


Hi,

	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
"${whatfailureproperty}"

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

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

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??

Regards,
____________________________
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
error.

**********************************************************************


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