ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: ?
Date Tue, 17 Oct 2000 16:14:59 GMT
--- Stefan Bodewig <> wrote:
> I'm not sure I understand the difference between changing the property
> in the file and overwriting the file with one that has the new
> value.

Well, there's the issue of being able to deal individually with the
properties that get written to it, rather than having to keep them all in
some big <echo>. Also, <propertyfile> (yea, I lower-cased the "f" --
seemed inconsistent having it be upper-case) has a date functionality, in
the form of yyyy/mm/dd hh:ss, which is something <tstamp> doesn't provide.
It also has increment and decrement functionality. And it handles putting
a comment-block at the top of the file.

So, for example, my target that gen's the file can deal
with setting only the "sanity" property in the state file, since that's
the only one it's concerned with. On the other hand, my "build" target can
deal with setting the "builddate" and "buildnum" properties (and which I
won't need to provide a <script> task to put together). Other targets will
deal with only setting other properties that concern them. This way, the
state properties that targets set are directly connected to the targets
themselves, and I don't need to have some other target whose sole purpose
is to just keep writing out all the properties the state file contains,
and I won't need to keep maintaining the list of all the state properties,
whenever new ones are added or old ones changed, off in that separate

Anyway, it's just coming in very handy for me, so I thought I'd at least
offer it back out to everyone else. BTW: I have switched to using Nico's
version -- it's cleaner in the way it deals with writing out the
properties to the file. Its format is:
    <propertyfile file="${state.file}" comment="${header}">
      <entry key="" type="int"  operation="+" />
      <entry key="" type="date" operation="now" />
      <entry key="" type="string" value="${prod}"/>
I did make a few minor changes to it, like changing "message" to be
"comment", since that seemed clearer (and I changed the code to not have
that be called copyrightMessage, since it isn't limited to holding just
copyright information), etc. One thing that does need to still happen for
it is the logging stuff needs to be upgraded to the way that's done now.



Do You Yahoo!?
Yahoo! Messenger - Talk while you surf!  It's FREE.

View raw message