Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 710 invoked from network); 23 Jul 2009 22:01:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Jul 2009 22:01:12 -0000 Received: (qmail 4849 invoked by uid 500); 23 Jul 2009 22:02:17 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 4761 invoked by uid 500); 23 Jul 2009 22:02:16 -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 4751 invoked by uid 99); 23 Jul 2009 22:02:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jul 2009 22:02:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jul 2009 22:02:06 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MU6MD-0005JJ-Gd for user@ant.apache.org; Thu, 23 Jul 2009 15:01:45 -0700 Message-ID: <24635303.post@talk.nabble.com> Date: Thu, 23 Jul 2009 15:01:45 -0700 (PDT) From: dkhanna123 To: user@ant.apache.org Subject: Re: failonerror for target and depends In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: dkhanna01@gmail.com References: <24629812.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi I understand how depends works but my question is.. If I have two targets defined in depends for e.g depends="target1,target2", and if some how target1 does not exist and instead of throwing error ant should move ahead (after showing some warning) and execute target2. THanks David Weintraub wrote: > > When you state that a target "A"is dependent upon target "B", target "B" > MUST run and execute before target "A" can execute. > > Ant isn't a programming language. It is a dependency matrix. You specify > which targets are dependent upon other targets, and Maven will sort out > the > build order for you. Are your "depends" other targets, or are you treating > them as command line parameters? > > Here's how depends work: > > * > > > > > > > > In this shell of a build script, if I do > > *$ ant package* > > Ant will look at target "package", and determine that it depends upon > target > "compile". Target "compile" depends upon target "getsource", so Ant will > run > targets "getsource", "compile", and "package" in that order. > > Note that target "clean" and target "test" don't get executed because > they're not in the dependency matrix that Ant built. Also notice that all > targets mentioned in the "depends" parameter must exist, and that a > failure > in any previously executed target will cause the build to fail. > > If you are trying to build a "subroutine", you should look at the > > task. You can define a macro that can have optional and required > parameters: > > ** > * * > ** > > ** > * * > * * > * * > * Called macro "bar" with parameters @{init1}, @{init2}, and > @{init3}* > * * > ** > > In the above, target "foo" calles the macro you defined, "bar". Because > there is no default value, you must include "init2" when calling bar. > However, you don't need "init1" or "init3" because they have default > values. > > Is this more what you're looking for? > > On Thu, Jul 23, 2009 at 12:46 PM, dkhanna123 wrote: > >> >> I have a target defined as : >> >> >> >> Now I want when ant call prompt target and if "init1" DOESNOT exist then >> it >> should continue with init2 and init3. >> >> I have used ant -k option but instead of continuing with init2 and init3 >> the >> whole prompt target exits. >> >> ANy suggestions >> -- >> View this message in context: >> http://www.nabble.com/failonerror-for-target-and-depends-tp24629812p24629812.html >> Sent from the Ant - Users mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org >> For additional commands, e-mail: user-help@ant.apache.org >> >> > > > -- > David Weintraub > qazwart@gmail.com > > -- View this message in context: http://www.nabble.com/failonerror-for-target-and-depends-tp24629812p24635303.html Sent from the Ant - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org