ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <cefn.ho...@bt.com>
Subject RE: <apply> and failifexecutionfails
Date Tue, 20 Sep 2005 09:11:25 GMT
I must admit that this area seems to be a real shortcoming in existing ANT tasks - not being
able to reliably swallow errors in subtasks, whatever they may be.

When I was trying to solve this problem before, there were suggestions as to how I can check
that the specific task (tomcat undeploy) would succeed before executing it, rather than being
able to support a failonerror property. This pre-validation is of course much more complex
and less useful for similar problems but which aren't for tomcat related tasks.

Is there a straightforward way to create a Task which swallows errors generically, regardless
of the type of task. Can it be built?

Cefn
http://cefn.com


-----Original Message-----
From: Nicolas Vervelle [mailto:nicolas.vervelle@steria.com]
Sent: Mon 9/19/2005 8:28 PM
To: Ant Users List
Subject: Re: <apply> and failifexecutionfails
 
Hi again,

I found how to overcome this problem : I first try to run xgettext2 
with <exec> task and with only one arg (--help) abd with attributes 
failifexecutionfails="false" resultproperty="xxx" just to check for 
xgettext2 existence.

Then I can use <apply> if xgettext2 exists.

To me, it really seems to be a bug in failifexecutionfails="false" for 
the <apply> task. It doesn't work, at least not in the same way of the 
<exec> task.

Nicolas


De: Nicolas Vervelle <nicolas.vervelle@steria.com>

> Hi,
> 
> I want to run an executable during the build only if the 
> executable is 
> available.
> How can I prevent the build from failing if the executable is not 
> here ?
> 
> I tried the failifexecutionfails attribute :
>    <apply executable="xgettext2" dir="${src.dir}" parallel="true"
>           verbose="true" relative="true" forwardslash="true"
>           failifexecutionfails="false">
>      <arg value="-kGT._" />
>      <arg value="--language=Java" />
>      <arg value="--msgid-bugs-address=jmol-
> developers@lists.sourceforge.net"/>
>      <arg value="--output-dir=${basedir}/${Jmol.po.dir}/tmp" />
>      <arg value="--output=Jmol.pot" />
>      <fileset dir="${src.dir}">
>        <include name="**/*.java"/>
>        <exclude name="**/jmol/applet/*.java"/>
>      </fileset>
>    
> 
> I thought that it would do the trick, but when I run the build 
> with the 
> executable missing, I got the following exception:
> E:\Java\Jmol-HEAD\build-i18n.xml:54: Execute failed: 
> java.io.IOException: CreateProcess: xgettext2 -kGT._ --
> language=Java --
> msgid-bugs-address=jmol-developers@lists.sourceforge.net --output-
> dir=E:\Java\Jmol-HEAD/src/org/jmol/translation/Jmol/tmp --
> output=Jmol.pot JmolApplet.java JmolAppletControl.java ...


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org





Mime
View raw message