Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 68068 invoked from network); 3 Oct 2003 14:57:30 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 3 Oct 2003 14:57:30 -0000 Received: (qmail 98174 invoked by uid 500); 3 Oct 2003 14:57:22 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 98135 invoked by uid 500); 3 Oct 2003 14:57:22 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 98112 invoked from network); 3 Oct 2003 14:57:20 -0000 Received: from unknown (HELO corvil.com) (213.94.219.177) by daedalus.apache.org with SMTP; 3 Oct 2003 14:57:20 -0000 Received: from preilly.local.corvil.com (preilly.local.corvil.com [172.18.1.173]) by corvil.com (8.12.9/8.12.5) with ESMTP id h93Ev6xe015259; Fri, 3 Oct 2003 15:57:07 +0100 (IST) (envelope-from peter.reilly@corvil.com) From: peter reilly Organization: corvil To: Ant Developers List , Emmanuel Feller Subject: Re: failonerror; general solution Date: Fri, 3 Oct 2003 15:57:42 +0100 User-Agent: KMail/1.5 References: <3F7D89E3.4090804@gmx.net> <03e901c389bc$c82dd650$48e304c2@efeller> In-Reply-To: <03e901c389bc$c82dd650$48e304c2@efeller> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200310031557.42102.peter.reilly@corvil.com> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Here is a task that does some like that: package task; import org.apache.tools.ant.taskdefs.Sequential; public class NoFail extends Sequential { private String failureProperty; public void setFailureProperty(String name) { this.failureProperty =3D name; } public void execute() { try { super.execute(); } catch (Throwable t) { if (failureProperty !=3D null) { getProject().setNewProperty( failureProperty, "true"); } } } } Usage: This should fail This will not be reached failed is ${failed} Peter On Friday 03 October 2003 15:43, Emmanuel Feller wrote: > I agree, it is a good option in my mind. > > +1 :) > > Emmanuel > ----- Message d'origine ----- > De : "Jan Schroeder" > =EF=BF=BD: > Envoy=EF=BF=BD: vendredi 3 octobre 2003 16:38 > Objet : failonerror; general solution > > > There are a few new entries in bugzilla regarding handling > > of > > > BuildExceptions. > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3D23540 > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3D23581 > > > Also, some tasks already implement some "failonerror" > > attribute (e.g. > > > ). > > > > What about creating a container task instead. > > Like: > > > > > > > > > > > > > > > > That way all tasks automatically have something like > > "failonerror" + you > > > actually know if the part failed and can take an > > appropriate build path > > > from here on. > > > > > > Jan > > > > > > ---------------------------------------------------------- > > ----------- > > > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > > For additional commands, e-mail: dev-help@ant.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org