ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ninju Bohra <ninju_bo...@yahoo.com>
Subject Re: sort or min/max file
Date Wed, 20 Jul 2005 14:13:40 GMT
You may want to look at the <sortlist> task (part of
the ant-contrib project).

If you are happy with sorting the files based upon the
name you can try the following (it is what we do):

            <path id="builds">
               <dirset
dir="${release.root}/Build_v${current.version.number}">
                  <include
name="Build_v${current.version.number}*"/>
               </dirset>
            </path>
            <sortlist property="sorted.builds"
refid="builds"/>
            <propertyregex property="max.build.number"
                           input="${sorted.builds}"
                           regexp="([0-9]*)$"
                           select="\1"/>

Have fun...
--- "Schulpen, D.P.H." <D.P.H.Schulpen@student.tue.nl>
wrote:

> I'm trying to write a script to automate certain
> parts of unzipping the most recent build archive of
> an application (in this case NetBeans) in a certain
> location.
> 
> However, I can't figure out a way to determine the
> most recent file. I thought about uptodate.
> Unfortunately, I have no idea how to run the task
> for every file in a list against all other files in
> the list, and determine which one returns true. I
> could also use lexical sorting or min/max-ing on the
> filename, but can't seem to find a task that
> supports this.
> 
> Some mailing list archive browsing seemed to hint
> that what I'm trying to achive is not yet possible
> with 1.6.5. Is this correct? If not, any pointers?
> 
> 
>  - Daan
> 






		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

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


Mime
View raw message