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:[EMAIL PROTECTED]
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 <[EMAIL PROTECTED]>

> 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-
> [EMAIL PROTECTED]"/>
>      <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 --
> [EMAIL PROTECTED] --output-
> dir=E:\Java\Jmol-HEAD/src/org/jmol/translation/Jmol/tmp --
> output=Jmol.pot JmolApplet.java JmolAppletControl.java ...


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to