ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Al Le <>
Subject Re: move rename date pattern
Date Sat, 20 Sep 2014 16:51:45 GMT
 > In directory $foo$ take file [\d\d\d\d-\d\d-\d\d zzz_today.ico] and
 > rename it to <... something not trivial ...>

If I have to do something which I can't easily do with standard Ant 
tasks I use the script task, usually with JavaScript. There, you can do 
whatever computations you want and pass the result to the outer script 
via project properties. In you case this would be parsing a date 
computing (and formatting) another date. The rest (file moving in your 
case) is done with the standard ant tasks.

On 20.09.2014 16:13, Erik Itter wrote:
> Hello,
> I am trying to automate my environment a little more and thought to do
> the following:
> In directory $foo$ take file [\d\d\d\d-\d\d-\d\d zzz_today.ico] and
> rename it to [yyyy-mm-dd zzz_today.ico] filling in the actual current
> date. Further I'd like to rename another file [\d\d\d\d-\d\d-\d\d
> zzz_one week.ico] to [yyyy-mm-dd zzz_one week.ico], obviously meaning
> the actual current date plus seven days.
> Guess I should be able to do it with some form of
> <move todir="$foo$"...>
>      <mapper type="regexp" .../>
> </move>
> but I am somewhat lost. I'd like to do it with the tasks provided if
> possible instead of writing my own task. All kinds of help/ advice/
> examples appreciated, of course.
> thx, Erik

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message