ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nat Gross <natgross.rentalsyst...@verizon.net>
Subject Re: AW: How can I set last modified date in html files using ant?
Date Wed, 09 Feb 2005 17:39:23 GMT
Jan.Materne@rzf.fin-nrw.de wrote:

>Hhmm - not easy ...
>1) "iterate" over a fileset
>2) check the date for each time
>3) modify the files content
>hmm - maybe (pseudo code):
>
>01: <for param="file">
>02:     <fileset .../>
>03:     <sequential>
>04:         <script>
>05:             importClass(Package.java.io.File);
>06:             f = new File("@{file}");
>07:             project.setProperty("date", f.lastModDate() );
>08:         </script>
>09:         <replaceregexp file="@{file}" match="..." replace="${date}"/>
>10:     </sequential>
>11: </for>
>
>  
>
Hey! I never knew you can instantiate any class in Ant! Can you please 
supply a url explaining  <script>?
Thanks;
-nat

>Line 7 is not "Ant-conform" - it overrides an existing property (usually you
>should use
>the setNewProperty() method). But this is a hack :)
>In Line 7 you also have to search for the right method in File :-)
>
>And ... no garantue :-O
>
>
>Jan
>  
>
>

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


Mime
View raw message