Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
How can I capture a file 's date to a property?

How can I capture a file 's date to a property?

2007-07-25       - By cknell@(protected)
Reply:     1     2     3     4     5     6     7     8     9     10  

Thanks again.
--
Charles Knell
cknell@(protected) - email



-----Original Message-----
From:     Dale Anson <danson@(protected)>
Sent:     Tue, 24 Jul 2007 20:13:41 -0600
To:       Ant Users List <user@(protected)>
Subject:  Re: How can I capture a file's date to a property?

What those mean is that there are other tasks or types with the same
name loaded via one of the numerous jars in your ant classpath.  You can
make the messages go away by using namespaces, which then lets Ant
explicitly pick the right task or type.  Try it like this and the
'trying to override' messages will go away:


<project name="fileutil_test" basedir="." default="test"
xmlns:a="antlib:ise.antelope.tasks">

   <taskdef resource="ise/antelope/tasks/antlib.xml"
            uri="ise.antelope.tasks"/>

   <target name="test">
       <property name="ant.jar" value="${ant.library.dir}/ant.jar"/>
       <a:fileutil file="${ant.jar}" property="ant_date">
           <a:lastmodified format="yyyy-MM-dd"/>
       </a:fileutil>
       <echo>timestamp on ant.jar is ${ant_date}</echo>
   </target>
</project>

This is a good thing to do when using third-party tasks, especially if
they are from more than one source.  It makes it a lot easier to figure
out what task comes from where.

Dale


cknell@(protected) wrote:
> Thanks. That does it, but what's the story on this set of messages that are
displayed when I run the task?
>
> Trying to override old definition of task antcallback
> Trying to override old definition of task antfetch
> Trying to override old definition of task assert
> Trying to override old definition of task bool
> Trying to override old definition of task foreach
> Trying to override old definition of task if
> Trying to override old definition of task limit
> Trying to override old definition of task math
> Trying to override old definition of task post
> Trying to override old definition of task stopwatch
> Trying to override old definition of task switch
> Trying to override old definition of task var
> Trying to override old definition of task replace
> Trying to override old definition of task length
> Trying to override old definition of datatype sort
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.