ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Douglas Kramer <Douglas.Kra...@Sun.COM>
Subject Ant: get today's date and replace old date
Date Thu, 27 Jan 2005 01:45:43 GMT

I want to set the date in the file of my project.
In the past I've used this Unix command to get today's date:

   DATE=`date '+%d %b %Y'`       // 26 Jan 2005

That is, how can I set the date and assign it to a variable in Ant?


Then I want to replace the date in the file below.
It looks like the Replace task won't work because it cannot do a wildcard
search.  This is what I've been using:

   sed "s/build...*)/build date: $DATE)/" < $VERSION_PROPERTIES > $VERSION_PROPERTIES_NEW

----------------------- ---------------------------
# @(#)
mifdoclet.version=1.5 beta 1 and 1.4 beta 1 (build date: 26 Jan 2005)

I suppose I could separate out the date and make it a separate property,
and then use the PropertyFile task to update it.


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

View raw message