Hey Simon,

 

You should set "failonerror" on the <exec> task instead.

 

Hope this helps,

 

Gert

 

From: Simon H [mailto:yo...@live.com] 
Sent: maandag 24 mei 2010 8:35
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] Question about <foreach> task and the failonerror
attribute

 

Hi guys,
 
I have made a build file for the automated compilation of Oracle Forms
files. An excerpt of the code is as follows:
 
<target name="build" description="compiles the source code">
 
... 
 

<foreach item="File" property="filename" failonerror="false" >

<in>

<items basedir="${source.directory}\${project.type}\Forms">

<include name="*.fmb" />

</items>

</in>
<do>

<exec program="${forms.path}"
workingdir="${source.directory}\${project.type}\Forms"
commandline="module=${filename} userid=${username}/${passwo...@${database}
batch=yes module_type=form compile_all=yes window_state=minimize" />

</do>

</foreach>
 

...

 

</target>

 

The build file navigates to the directory containing the forms that the user
desires fo compile and attempts to compile each form. The failonerror
attribute is set to false so that the build file does not exit if a
compilation error occurs. Unfortunately, however, though this prevents the
build file from exiting when a compilation error occurs, it also appears to
make the build file exit the <foreach> task. This is a problem because,
unless the form that does not compile successfully is the last to be tested
(based on the filename of the form in alphanumerical decsending order),
there will be one or more forms that the build file does not attempt to
compile. So, for example, if the folder containing the forms that are
desired to be compiled contains 10 forms and the first form does not compile
successfully, the build file will not attempt to compile the remaining 9
forms (ie exit the <foreach> task). Is there a way to make the build file
attempt to compile remaining forms after encountering after failing to
compile a form? Thanks in advance!

 

  _____  

Australia's #1 job site If It Exists, You'll Find it on SEEK
<http://clk.atdmt.com/NMN/go/157639755/direct/01/> 

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.819 / Virus Database: 271.1.1/2888 - Release Date: 05/23/10
20:26:00

------------------------------------------------------------------------------

_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to