Question about <foreach> task and the failonerror attribute

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Question about <foreach> task and the failonerror attribute

Simon H-2
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}/${password}@${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
------------------------------------------------------------------------------


_______________________________________________
NAnt-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nant-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Question about <foreach> task and the failonerror attribute

drieseng
Administrator

Hey Simon,

 

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

 

Hope this helps,

 

Gert

 

From: Simon H [mailto:[hidden email]]
Sent: maandag 24 mei 2010 8:35
To: [hidden email]
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}/${password}@${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

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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nant-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Question about <foreach> task and the failonerror attribute

Simon H-2
Ahhhhhhh, yep that works great. Thanks Gert!
 

From: [hidden email]
To: [hidden email]; [hidden email]
Subject: RE: [NAnt-users] Question about <foreach> task and the failonerror attribute
Date: Mon, 24 May 2010 08:45:15 +0200

Hey Simon,

 

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

 

Hope this helps,

 

Gert

 

From: Simon H [mailto:[hidden email]]
Sent: maandag 24 mei 2010 8:35
To: [hidden email]
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}/${password}@${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

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



Find it at CarPoint.com.au New, Used, Demo, Dealer or Private?
------------------------------------------------------------------------------


_______________________________________________
NAnt-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nant-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Question about <foreach> task and the failonerror attribute

Simon H-2
In reply to this post by drieseng
Perhaps there's one more mystery that you can assist me with. For the compilation of Reports I have the following <foreach> task:
 

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

<in>

<items basedir="${source.directory}\${project.type}\Reports">
<include name="*.rdf" />
</items>
</in>
<
do>
<exec program="${reports.path}" workingdir="${source.directory}\${project.type}\Reports" commandline="userid=${username}/${password}@${database} batch=yes source=${filename} stype=rdffile dtype=repfile compile_all=yes overwrite=yes logfile=log.txt" failonerror="false" />
</do>
</foreach>


All reports compile correctly, but for some reason the output for each Report compilation is "[exec] Could not read reports properties." I have no idea what this is referring to and it does not appear to indicate any compilation error. Any ideas? Thanks in advance! 

From: [hidden email]
To: [hidden email]; [hidden email]
Subject: RE: [NAnt-users] Question about <foreach> task and the failonerror attribute
Date: Mon, 24 May 2010 08:45:15 +0200

Hey Simon,

 

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

 

Hope this helps,

 

Gert

 

From: Simon H [mailto:[hidden email]]
Sent: maandag 24 mei 2010 8:35
To: [hidden email]
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}/${password}@${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

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



Australia's #1 job site If It Exists, You'll Find it on SEEK
------------------------------------------------------------------------------


_______________________________________________
NAnt-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nant-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Question about <foreach> task and the failonerror attribute

drieseng
Administrator

Hey Simon,

 

I’m afraid I can’t be of much help here. I’d have to know which compiler you’re using.

Can you send me the minimum set of files necessary to reproduce this ?

 

Gert

 

From: Simon H [mailto:[hidden email]]
Sent: maandag 24 mei 2010 9:08
To: [hidden email]; [hidden email]
Subject: RE: [NAnt-users] Question about <foreach> task and the failonerror attribute

 

Perhaps there's one more mystery that you can assist me with. For the compilation of Reports I have the following <foreach> task:
 

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

<in>

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

<include name="*.rdf" />

</items>

</in>
<
do>

<exec program="${reports.path}" workingdir="${source.directory}\${project.type}\Reports" commandline="userid=${username}/${password}@${database} batch=yes source=${filename} stype=rdffile dtype=repfile compile_all=yes overwrite=yes logfile=log.txt" failonerror="false" />

</do>

</foreach>

 

All reports compile correctly, but for some reason the output for each Report compilation is "[exec] Could not read reports properties." I have no idea what this is referring to and it does not appear to indicate any compilation error. Any ideas? Thanks in advance! 


From: [hidden email]
To: [hidden email]; [hidden email]
Subject: RE: [NAnt-users] Question about <foreach> task and the failonerror attribute
Date: Mon, 24 May 2010 08:45:15 +0200

Hey Simon,

 

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

 

Hope this helps,

 

Gert

 

From: Simon H [mailto:[hidden email]]
Sent: maandag 24 mei 2010 8:35
To: [hidden email]
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}/${password}@${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

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

 


Australia's #1 job site If It Exists, You'll Find it on SEEK

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


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


_______________________________________________
NAnt-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nant-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Question about <foreach> task and the failonerror attribute

Charles Chan-3
In reply to this post by Simon H-2
Hello Simon,

(In addition to the Gert's suggestion.)

From the message, it appears it is coming from the Oracle Forms program. (I haven't used it before.)

Typically when I see a strange message, I would:
1) use <echo> task to print out the value of "program" and "commandline" attribute.

2) change to the base directory, and manually execute "program" with the "commandline" args.

This should help you reproduce the problem outside of NAnt, and hopefully give you enough clues on what's missing.

I hope this helps.
Charles

--- On Mon, 5/24/10, Simon H <[hidden email]> wrote:

From: Simon H <[hidden email]>
Subject: Re: [NAnt-users] Question about <foreach> task and the failonerror attribute
To: [hidden email], [hidden email]
Received: Monday, May 24, 2010, 7:07 AM

Perhaps there's one more mystery that you can assist me with. For the compilation of Reports I have the following <foreach> task:
 

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

<in>

<items basedir="${source.directory}\${project.type}\Reports">
<include name="*.rdf" />
</items>
</in>
<
do>
<exec program="${reports.path}" workingdir="${source.directory}\${project.type}\Reports" commandline="userid=${username}/${password}@${database} batch=yes source=${filename} stype=rdffile dtype=repfile compile_all=yes overwrite=yes logfile=log.txt" failonerror="false" />
</do>
</foreach>


All reports compile correctly, but for some reason the output for each Report compilation is "[exec] Could not read reports properties." I have no idea what this is referring to and it does not appear to indicate any compilation error. Any ideas? Thanks in advance! 

From: [hidden email]
To: [hidden email]; [hidden email]
Subject: RE: [NAnt-users] Question about <foreach> task and the failonerror attribute
Date: Mon, 24 May 2010 08:45:15 +0200

Hey Simon,

 

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

 

Hope this helps,

 

Gert

 

From: Simon H [mailto:[hidden email]]
Sent: maandag 24 mei 2010 8:35
To: [hidden email]
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}/${password}@${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

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



Australia's #1 job site If It Exists, You'll Find it on SEEK

-----Inline Attachment Follows-----

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


-----Inline Attachment Follows-----

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


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


_______________________________________________
NAnt-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nant-users
Loading...