Worked wonderfully, thanks! On Jun 2, 2011, at 3:37 PM, Vimil Saju wrote: > You could also use the trycatch task from antcontrib. the try task has a catch block that executes when any of the tasks within the try block fails. > > --- On Thu, 6/2/11, Eric Fetzer wrote: > > From: Eric Fetzer > Subject: Re: Do things based on project success or failure > To: "Ant Users List" > Date: Thursday, June 2, 2011, 12:31 PM > > No problem Rob! The way I posted works great, I was just wondering if there was > a more graceful way to do it. I think I can get the properties to pass as well > with the echoproperties task... Thanks! > > > > > ________________________________ > From: "Echlin, Robert" > To: Ant Users List > Sent: Thu, June 2, 2011 1:29:18 PM > Subject: RE: Do things based on project success or failure > > Hi Eric, > I didn't get that ant was failing out on you. Sorry. > I will check on that. > > Rob > >> -----Original Message----- >> From: Eric Fetzer [mailto:elstonkers@yahoo.com] >> Sent: Thursday, June 02, 2011 2:22 PM >> To: Ant Users List >> Subject: Re: Do things based on project success or failure >> >> Thanks Robert, I've already got the db stuff working using >> jdbc and . Of course with a mysql database, it didn't >> work until I added perms for the user from the IP that I'm >> talking to it on: >> >> grant all on dbname.* to 'username'@'ip.addy' identified by >> 'userpassword'; >> >> I don't see, however, how antcall or subant will solve my >> issue with being able to do something after the build fails. >> Ant turns tail and runs after a failure, there is no saying: >> onFailure DO... That's why I'm calling it from the exec task. >> Then I separate from the process and gather a return code on >> the other side... Maybe I'm missing something. >> >> Thanks, >> Eric >> >> >> >> >> ________________________________ >> From: "Echlin, Robert" >> To: Ant Users List >> Sent: Thu, June 2, 2011 10:02:02 AM >> Subject: RE: Do things based on project success or failure >> >> Hi Eric, >> Look up "subant" and "antcall" for a start. They are in "core tasks". >> If you put both tasks in the same xml file, you will use "antcall". >> >> Also, for your DB operation, look up "sql" task, which uses JDBC. >> >> Rob >> >> -- >> Rob Echlin, Documentation Systems Architect, Wind River >> direct: +1.613.270.5796 | robert.echlin@windriver.com >> >> >>> -----Original Message----- >>> From: Eric Fetzer [mailto:elstonkers@yahoo.com] >>> Sent: Thursday, June 02, 2011 11:20 AM >>> To: Ant Users List >>> Subject: Re: Do things based on project success or failure >>> >>> Of course this presents me another issue. How do I gather >> up all of >>> the command line arguments that were passed to me so that I can >>> re-pass them to the next ant script. Is there a way to say: >>> >> value="allOfMyArgsThatWerePassedToMe"/>? >>> >>> Thanks, >>> Eric >>> >>> >>> >>> >>> ________________________________ >>> From: Eric Fetzer >>> To: Ant Users >>> Sent: Thu, June 2, 2011 9:02:14 AM >>> Subject: Do things based on project success or failure >>> >>> I have to update a database one way or another based on project >>> success or failure. So I'm messing around with the >> task with >>> errorproperty attribute. I'm trying to make it so that >> failure will >>> test one way vs. success testing another. The best thing I >> can come >>> up with is the following: >>> >>> <-----------------------------------------------------------------> >>> Build File 1: >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> Build File 2: >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> So if I pass >ant -f test.xml -Dgood="true" >>> I end up in the success code. Or if I pass >ant -f test.xml >>> -Dgood="anythingElse" >>> I end up in the failure code. >>> >>> Does anyone have a more graceful way to do this? >>> >>> Thanks, >>> Eric >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For >> additional commands, e-mail: user-help@ant.apache.org > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org