Return-Path: X-Original-To: apmail-ant-user-archive@www.apache.org Delivered-To: apmail-ant-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 06B7D4446 for ; Thu, 2 Jun 2011 20:09:51 +0000 (UTC) Received: (qmail 98759 invoked by uid 500); 2 Jun 2011 20:09:50 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 98728 invoked by uid 500); 2 Jun 2011 20:09:50 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 98720 invoked by uid 99); 2 Jun 2011 20:09:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jun 2011 20:09:50 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [98.139.52.207] (HELO nm10.bullet.mail.ac4.yahoo.com) (98.139.52.207) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 02 Jun 2011 20:09:40 +0000 Received: from [98.139.52.191] by nm10.bullet.mail.ac4.yahoo.com with NNFMP; 02 Jun 2011 20:09:17 -0000 Received: from [98.139.52.135] by tm4.bullet.mail.ac4.yahoo.com with NNFMP; 02 Jun 2011 20:09:17 -0000 Received: from [127.0.0.1] by omp1018.mail.ac4.yahoo.com with NNFMP; 02 Jun 2011 20:09:17 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 521138.15545.bm@omp1018.mail.ac4.yahoo.com Received: (qmail 4282 invoked by uid 60001); 2 Jun 2011 20:09:17 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1307045357; bh=a6NmwEqGnfcH/PeuzlHi9hebo9xw2xXj0KwFzJZ3uvE=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=qAoxax/X0fJgM2GBraVeTGYvD3PCwmS3+s/OtdosLc0RDpKpqHnxumrC4fMdjwmw8yhF5ggFWxcfDQUFcOqiltLXh+Slzt8dzCwRvlCpzHdBK8CVoekPru8dE7UiUDmO0fDG+IMttL5llbCXqr5ZlhVVIF/XjMYOB8pSqbmiTR4= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=B/WuXIETkl24dCXrG3HUNmGl0lc3qTFJw7Av57fLgyEh3Cf3okud/uR0TmGgQnxJ0wajQXuCqDgYICzfKE7Cvxmv1SUxFiAgs/CxplsAqMB7pQW+OYE20m63dDx8y9utLc0TODgHSCsu21yEw9tZmtY3kHvCzBvkJ/En0ohzxfo=; Message-ID: <258318.884.qm@web65702.mail.ac4.yahoo.com> X-YMail-OSG: O156CBcVM1mK6HJNiqumvtp8QZZaT2n2tezqf1qfx973sNF z67gWgjo7iamAhDpDDhU6NoQiupaAxZAiCG9KQyWyrSsKV8jR8L9j.vNKtQ1 nxk9a2BvinVYUwKC3Vef3KiXE8UPfES_Cxt.LGfdkXWpJjXFr_d4IzC7WLy4 lOMUuz_QOo6zvG3zQRw6FkQJeeCZhUdMEupU2I4519YVnzxVDeITWVDzOL4m oKzRcGFF_QgtHspaar7UR7OJGLq1ZI4acuQjir2DeYJ7EN6Y2a7dz9mG_rPq UdYmbKaXFk6rjhhpPIiuDl.LvTrfaHRC4rpAPsRFsGMwHPyVipaTVqxNup8q ljzUdMazy0dueRErnZMkKiSy125fPVWuE7iuawajp8d6G2ObfI.ggH0kMYlu zwLf6nie59ZAAXw-- Received: from [98.238.28.69] by web65702.mail.ac4.yahoo.com via HTTP; Thu, 02 Jun 2011 13:09:17 PDT X-Mailer: YahooMailRC/570 YahooMailWebService/0.8.111.303096 References: <785008.91138.qm@web161215.mail.bf1.yahoo.com> Date: Thu, 2 Jun 2011 13:09:17 -0700 (PDT) From: Eric Fetzer Subject: Re: Do things based on project success or failure To: Ant Users List In-Reply-To: <785008.91138.qm@web161215.mail.bf1.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1285152505-1307045357=:884" X-Virus-Checked: Checked by ClamAV on apache.org --0-1285152505-1307045357=:884 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable That seems a whole lot easier, thanks!=A0 I'll give that a shot.=A0 That wa= y I can =0Ause the task and allow the args to just be inherited...=0A= =0A=0A=0A=0A________________________________=0AFrom: Vimil Saju =0ATo: Ant Users List =0ASent: Thu, June 2, = 2011 1:37:26 PM=0ASubject: Re: Do things based on project success or failur= e=0A=0AYou could also use the trycatch task from antcontrib. the try task h= as a catch =0Ablock that executes when any of the tasks within the try bloc= k fails.=0A=0A--- On Thu, 6/2/11, Eric Fetzer wrote:= =0A=0AFrom: Eric Fetzer =0ASubject: Re: Do things bas= ed on project success or failure=0ATo: "Ant Users List" =0ADate: Thursday, June 2, 2011, 12:31 PM=0A=0ANo problem Rob!=A0 The way= I posted works great, I was just wondering if there was =0A=0Aa more grace= ful way to do it.=A0 I think I can get the properties to pass as well =0Awi= th the echoproperties task...=A0 Thanks!=0A=0A=0A=0A=0A____________________= ____________=0AFrom: "Echlin, Robert" =0ATo: A= nt Users List =0ASent: Thu, June 2, 2011 1:29:18 PM=0A= Subject: RE: Do things based on project success or failure=0A=0AHi Eric,=0A= I didn't get that ant was failing out on you. Sorry.=0AI will check on that= .=0A=0ARob =0A=0A> -----Original Message-----=0A> From: Eric Fetzer [mailto= :elstonkers@yahoo.com] =0A> Sent: Thursday, June 02, 2011 2:22 PM=0A> To: A= nt Users List=0A> Subject: Re: Do things based on project success or failur= e=0A> =0A> Thanks Robert, I've already got the db stuff working using =0A> = jdbc and .=A0 Of course with a mysql database, it didn't =0A> work unt= il I added perms for the user from the IP that I'm =0A> talking to it on:= =0A> =0A> grant all on dbname.* to 'username'@'ip.addy' identified by =0A> = 'userpassword';=0A> =0A> I don't see, however, how antcall or subant will s= olve my =0A> issue with being able to do something after the build fails.= =A0 =0A> Ant turns tail and runs after a failure, there is no saying:=A0 = =0A> onFailure DO... That's why I'm calling it from the exec task.=A0=0A>= =A0 Then I separate from the process and gather a return code on =0A> the o= ther side...=A0 Maybe I'm missing something.=0A> =0A> Thanks,=0A> Eric=0A> = =0A> =0A> =0A> =0A> ________________________________=0A> From: "Echlin, Rob= ert" =0A> To: Ant Users List =0A> Sent: Thu, June 2, 2011 10:02:02 AM=0A> Subject: RE: Do things bas= ed on project success or failure=0A> =0A> Hi Eric,=0A> Look up "subant" and= "antcall" for a start. They are in "core tasks".=0A> If you put both tasks= in the same xml file, you will use "antcall".=0A> =0A> Also, for your DB o= peration, look up "sql" task, which uses JDBC.=0A> =0A> Rob=0A> =0A> --=0A>= Rob Echlin, Documentation Systems Architect, Wind River=0A> direct: +1.613= .270.5796=A0 |=A0 robert.echlin@windriver.com=0A> =0A> =0A> > -----Original= Message-----=0A> > From: Eric Fetzer [mailto:elstonkers@yahoo.com]=0A> > S= ent: Thursday, June 02, 2011 11:20 AM=0A> > To: Ant Users List=0A> > Subjec= t: Re: Do things based on project success or failure=0A> > =0A> > Of course= this presents me another issue.=A0 How do I gather =0A> up all of =0A> > t= he command line arguments that were passed to me so that I can =0A> > re-pa= ss them to the next ant script.=A0 Is there a way to say:=A0 =0A> > > value=3D"allOfMyArgsThatWerePassedToMe"/>?=0A> > = =0A> > Thanks,=0A> > Eric=0A> > =0A> > =0A> > =0A> > =0A> > _______________= _________________=0A> > From: Eric Fetzer =0A> > To: = Ant Users =0A> > Sent: Thu, June 2, 2011 9:02:14 AM=0A= > > Subject: Do things based on project success or failure=0A> > =0A> > I h= ave to update a database one way or another based on project =0A> > success= or failure.=A0 So I'm messing around with the =0A> task with =0A> >= errorproperty attribute.=A0 I'm trying to make it so that =0A> failure wil= l =0A> > test one way vs. success testing another.=A0 The best thing I =0A>= can come =0A> > up with is the following:=0A> > =0A> > <------------------= ----------------------------------------------->=0A> > Build File 1:=0A> > = =0A> > =0A> > =A0=0A> > =A0=0A> > = =A0=A0=A0 =0A> > =A0=A0=A0=A0=A0 =0A> > =A0=A0=A0 =0A> > =A0=A0=A0 =0A> > =A0=A0 =0A> > =A0=A0=A0 =0A> > =A0=A0=A0=A0=A0 = =0A> > =A0=A0=A0=A0=A0 =0A= > > =A0=A0=A0=A0=A0=A0=A0 =0A> > =A0=A0=A0= =A0=A0 =0A> > =A0=A0=A0=A0=A0 =0A> > =A0=A0=A0=A0=A0=A0=A0 =0A> > =A0=A0=A0=A0=A0 =0A> > =A0=A0=A0 =0A> > =A0=0A> > =0A> > =0A> > Build File 2:=0A> > = =0A> > =0A> > =A0=0A> > =A0=0A> > = =A0=A0 =0A> > =A0=A0 =0A> > = =A0=A0=A0=A0 =0A> > =A0=A0=A0=A0=A0=A0 =0A> = > =A0=A0=A0=A0 =0A> > =A0=A0=A0=A0 =0A> > =A0=A0=A0=A0=A0=A0 <= echo message=3D"Bad"/>=0A> > =A0=A0=A0=A0=A0=A0 =0A> > =A0=A0=A0=A0 = =0A> > =A0=A0 =0A> > =A0=0A> > =0A> > =0A> >= =0A> >= =0A> > So if I pass >ant -f test.xml -Dgood=3D"true"=0A> > I end up in the= success code.=A0 Or if I pass >ant -f test.xml =0A> > -Dgood=3D"anythingEl= se"=0A> > I end up in the failure code.=0A> > =0A> > Does anyone have a mor= e graceful way to do this?=0A> > =0A> > Thanks,=0A> > Eric=0A> ------------= ---------------------------------------------------------=0A> To unsubscrib= e, e-mail: user-unsubscribe@ant.apache.org For =0A> additional commands, e-= mail: user-help@ant.apache.org=0A------------------------------------------= ---------------------------=0ATo unsubscribe, e-mail: user-unsubscribe@ant.= apache.org=0AFor additional commands, e-mail: user-help@ant.apache.org --0-1285152505-1307045357=:884--