ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dick, Brian E." <Brian.D...@FMR.com>
Subject RE: Loadfile not loading file
Date Thu, 19 Aug 2004 12:14:52 GMT
The property gets set only if the file contains the string. The loadfile
task doc doesn't explicitly state this behavior. Hopefully, it will
continue to work this way.

-----Original Message-----
From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
Sent: Wednesday, August 18, 2004 5:31 PM
To: Ant Users List
Subject: RE: Loadfile not loading file


Sorry, I was thinking the property would be set even
if file were empty (or filtered so that it appeared
empty).

-Matt

--- "Dick, Brian E." <Brian.Dick@FMR.com> wrote:

> Fortunately, I want to fail the first time the
> property is set. It's
> immutability is mute.
> 
> -----Original Message-----
> From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
> Sent: Wednesday, August 18, 2004 5:19 PM
> To: Ant Users List
> Subject: RE: Loadfile not loading file
> 
> 
> I was about to write back and suggest something like
> this.  However, be careful using <loadfile>.  It
> looks
> like property immutability will stop you from
> detecting the error condition in any but the first
> file.  Unfortunately (and I hate temp files worse
> than
> almost anything in programming) I would recommend
> using two <concat> tasks, one to display to the
> console and the other to filter to a temp file
> instead
> of a property.  The other option is to "pollute"
> your
> properties by using a discrete property name
> including
> @{f} for each list value.
> 
> -Matt
> 
> --- "Dick, Brian E." <Brian.Dick@FMR.com> wrote:
> 
> > This is my work around. The downside is that I
> have
> > to wait until the
> > exe completes before I see the output. I would
> > rather see the output in
> > real time. If there is a redirector option to tee
> > output in 1.6.3, I can
> > wait.
> > 
> > <for param="f">
> >    <path refid="mypath"/>
> >    <sequential>
> >       <exec executable="lamexe" input="@{f}"
> > output="lamexe.log"/>
> >       <!-- dump output to log -->
> >       <concat>
> >          <filelist dir="." files="lamexe.log"/>
> >       </concat>
> >       <!-- scan output for error -->
> >       <loadfile property="lamexe.error"
> > srcfile="lamexe.log">
> >          <filterchain>
> >             <linecontains>
> >                <contains value="ERROR"/>
> >             </linecontains>
> >          </filterchain>
> >       </loadfile>
> >       <fail if="lamexe.error"/>
> >    </sequential>
> > </for>
> > 
> > -----Original Message-----
> > From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
> > Sent: Wednesday, August 18, 2004 4:59 PM
> > To: Ant Users List
> > Subject: RE: Loadfile not loading file
> > 
> > 
> > I can see about adding attributes to keep the log
> > output, but I'm at a loss with 1.6.2, then, unless
> > you
> > want to write some custom code.
> > 
> > -Matt
> > 
> > --- "Dick, Brian E." <Brian.Dick@FMR.com> wrote:
> > 
> > > The output file can contain good stuff, too. And
> I
> > > want to see it in the
> > > log.
> > > 
> > > -----Original Message-----
> > > From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
> > > Sent: Wednesday, August 18, 2004 4:45 PM
> > > To: Ant Users List
> > > Subject: RE: Loadfile not loading file
> > > 
> > > 
> > > --- "Dick, Brian E." <Brian.Dick@FMR.com> wrote:
> > > 
> > > > Thanks for <for>. It is definitely better than
> > > > <foreach>.
> > > > 
> > > > I can't wrap the for with a single <record
> > > > action="start"> and <record action="stop">
> > > > Pair. I'm running an <exec> in the <for> body
> > that
> > > > doesn't set a return code on failure. I need
> to
> > > scan
> > > > the scan the output of each iteration of the
> > > <exec>
> > > > to check for an ERROR string.
> > > > 
> > > 
> > > hmmm... what about:
> > > 
> > > <for param="f">
> > >   <path refid="yourpath">
> > >   <sequential>
> > >     <delete file="errorfile" />
> > >     <exec executable="yourexe">
> > >       <redirector output="errorfile"
> > >                   createemptyfiles="false">
> > >         <outputfilterchain>
> > >           <linecontains>
> > >             <contains value="ERROR" />
> > >           </linecontains>
> > >         </outputfilterchain>
> > >       </redirector>
> > >     </exec>
> > >     <fail message="ERROR with @{f}">
> > >       <condition>
> > >         <available file="errorfile" type="f" />
> > >       </condition>
> > >     </fail>
> > >   </sequential>
> > > </for>
> > > 
> > > -Matt
> > > 
> > > 
> > > 		
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! Mail - 50x more storage than other
> > providers!
> > > http://promotions.yahoo.com/new_mail
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail:
> > > user-help@ant.apache.org
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail:
> > > user-help@ant.apache.org
> > > 
> > > 
> > 
> > 
> > 
> > 		
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail - 50x more storage than other
> providers!
> > http://promotions.yahoo.com/new_mail
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> > 
> > 
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail is new and improved - Check it out!
> http://promotions.yahoo.com/new_mail
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> 
=== message truncated ===



		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

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

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


Mime
View raw message