Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 46923 invoked from network); 25 Nov 2001 06:22:24 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 25 Nov 2001 06:22:24 -0000 Received: (qmail 5607 invoked by uid 97); 25 Nov 2001 06:22:31 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 5561 invoked by uid 97); 25 Nov 2001 06:22:30 -0000 Mailing-List: contact ant-dev-help@jakarta.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 ant-dev@jakarta.apache.org Received: (qmail 5548 invoked from network); 25 Nov 2001 06:22:29 -0000 Message-ID: <000c01c17579$8f197f30$0201a8c0@nordwand> From: "Steve Loughran" To: "ant-dev" Subject: [PATCH] some diffs to ExecTask Date: Sat, 24 Nov 2001 22:22:28 -0800 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0009_01C17536.8075EBA0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0009_01C17536.8075EBA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit I'm dont want to commit these until people have had a look at the changes and are happy with them. Apart from some tabs to spaces conversion , the two big changes here are 1. you can specify a resultproperty that saves the result value into an (undefined) property. Obviously only of relevance if failonerror=false 2. when failonerror=false, failure to exec a task does not break the build, only report an error message [and leave the resultproperty untouched]. This addresses bug 5025; that failonerror didnt catch all failure modes of the task. Comments? Opinions? ------=_NextPart_000_0009_01C17536.8075EBA0 Content-Type: text/plain; name="execpatch.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="execpatch.txt" Index: ExecTask.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: = /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ExecTask.jav= a,v retrieving revision 1.17 diff -r1.17 ExecTask.java 94a95 > private String resultProperty; 180a182,202 > * fill a property in with a result.=20 > * when no property is defined: failure to execute > * @since 1.5 > */ > public void setResultProperty(String resultProperty) { > this.resultProperty=3DresultProperty; > } > =20 > /** > * helper method to set result property to the=20 > * passed in value if appropriate > */ > protected void maybeSetResultPropertyValue(int result) { > String res=3DInteger.toString(result); > if(resultProperty!=3Dnull > && project.getProperty(resultProperty) =3D=3D null) { > project.setProperty(resultProperty,res); > } > } > =20 > /** 198c220 < throw new BuildException("The directory you specified does = not exist"); --- > throw new BuildException("The directory you specified does = not exist"); 201c223 < throw new BuildException("The directory you specified is not = a directory"); --- > throw new BuildException("The directory you specified is = not a directory"); 258d279 <=20 259a281 > maybeSetResultPropertyValue(err); 290c312,316 < throw new BuildException("Execute failed: " + e, e, = location); --- > if (failOnError) { > throw new BuildException("Execute failed: ",e, = location); > } else { > log("Execute failed: "+e.toString(), Project.MSG_ERR); > } 312,315c338,341 < // try { < baos =3D new ByteArrayOutputStream(); < log("Output redirected to ByteArray", Project.MSG_VERBOSE); < return new PumpStreamHandler(baos); --- > // try { > baos =3D new ByteArrayOutputStream(); > log("Output redirected to ByteArray", = Project.MSG_VERBOSE); > return new PumpStreamHandler(baos); ------=_NextPart_000_0009_01C17536.8075EBA0 Content-Type: text/plain; charset=us-ascii -- To unsubscribe, e-mail: For additional commands, e-mail: ------=_NextPart_000_0009_01C17536.8075EBA0--