ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peterrei...@apache.org>
Subject Re: AW: How can I set last modified date in html files using ant?
Date Thu, 10 Feb 2005 09:19:50 GMT
Personally I find beanshell to be easier to use than
javascript (or the other scripting languages) as it's
sytax is *very* close to java.

    <property name="filename" location="build.xml"/>
    <script language="beanshell">
      import java.io.File;
      f = new File(filename);
      project.setProperty("date", "" + f.lastModified());
    </script>
    <echo>Last modified is ${date}</echo>

Peter

Keith Hatton wrote:

>http://ant.apache.org/manual/index.html
>Ant Tasks -> Optional Tasks -> Script
>
>Be careful about the library dependencies - exactly which version of
>BSF/Rhino you need will depend on which version of Ant you have (that
>link currently points to the 1.6.2 manual).
>
>Keith
>
>
>-----Original Message-----
>  
>
>Hey! I never knew you can instantiate any class in Ant! Can you please 
>supply a url explaining  <script>?
>Thanks;
>-nat
>
>---------------------------------------------------------------------
>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