ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Siri <as...@printcafe.com>
Subject RE: Wildcards in the file attribute for the available task
Date Thu, 11 Jul 2002 15:16:34 GMT
Wow, thanks!

Didn't know you could imbed Java code like that - very cool.

I also took a look at the Available task's source to see what could be done
with it - maybe open it up to accept a fileset?

In any case, I have a few things to try out now.

Again, thanks,

-Aaron

> -----Original Message-----
> From: Diane Holt [mailto:holtdl@yahoo.com]
> Sent: Wednesday, July 10, 2002 7:29 PM
> To: Ant Users List
> Subject: RE: Wildcards in the file attribute for the available task
> 
> 
> I couldn't think of any way to do it other than using 
> <script>, along with
> <parallel> and <waitfor>. (Well, I suppose you could 86 the 
> <parallel> and
> <waitfor> and just have the script do the timeout, but it 
> gave me a good
> excuse to play with them, and besides, it's less script code 
> this way).
> 
>   <target name="waitforit">
>     <property name="msgdir" location="jbossmq"/>
>     <parallel>
>       <waitfor maxwait="10" maxwaitunit="second" 
> timeoutproperty="stuck">
>         <isset property="all.gone"/>
>       </waitfor>
>       <script language="javascript"> <![CDATA[
>         dir = new java.io.File(project.getProperty("msgdir")) ;
>         for( ;; ) {
>           if( dir.list().length == 0 ) {
>             project.setNewProperty("all.gone", "true");
>             break;
>           } else {
>             if( project.getProperty("stuck") != null ) { break ; }
>           }
>           java.lang.Thread.sleep(5000); // give it a rest :)
>         }
>         ]]>
>       </script>
>     </parallel>
>     <fail unless="all.gone" message="Messages are stuck in 
> the queue!"/>
>     <echo>All gone!</echo>
>   </target>
> 
> Of course, you'll want to up your "maxwaitunit" -- I just 
> didn't feel like
> sitting around for 10 minutes waiting to see if it worked :)
> 
> Also, it does rely on the idea that no files other than queued message
> files live in that directory -- if that's not really 
> guaranteed, you'll
> need to beef it up to list only the pertinent files.
> 
> Diane
> 
> =====
> (holtdl@yahoo.com)
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Sign up for SBC Yahoo! Dial - First Month Free
> http://sbc.yahoo.com
> 
> --
> To unsubscribe, e-mail:   
> <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:ant-user-help@jakarta.apache.org>
> 

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


Mime
View raw message