You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Nicolas Vervelle <ni...@steria.com> on 2005/09/19 19:10:16 UTC
and failifexecutionfails
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>
</apply>
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 ...
Failifexecutionfails is not well documented in the <apply> task, but in
the <exec> task, there is this note about this attribute : "You can use
that to run a program if it exists, but otherwise do nothing."
I thought it would be the same for <apply>, but that's not the case.
I am using Ant bundled with Eclipse 3.1.
TIA,
Nicolas
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org