ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bevan Arps <>
Subject Proposal: "Local" Immutable properties
Date Tue, 27 Nov 2001 02:56:27 GMT

Damn! Just realized I posted this to ant-user instead of ant-dev. Sorry 
about that ...


I've been following this discussion and just saw Bruce Atherton's post 
about using DSTAMP and TSTAMP to time portions of builds, and this 
triggered a thought.

We on the list seem to be agreeing that properties should all be immutable.

But should they all be global? (or at least, should they be globally 
accessible from whenever they were first set, or should their lifetime be 

It seems to me that the question of "Should we be able to change a property 
after it has been set?" is different to "Where should we be able to use 
this property?"

I have a suggestion: How about adding a new attribute to target specifying 
local-properties that works as follows:

- When the target is invoked, an exception is raised if any of the 
properties are already set (preserve property immutability, and ensure 
they're not set at the start)

- When the target is complete, any values for the named properties are 
removed from the project (limits scope)

eg (using Bruce's example):

   <target name="build" depends="init,checkout,compile" />

   <target name="init" local-properties="DSTAMP,TSTAMP" >
     <tstamp />
     <echo message="Started Build - ${DSTAMP} ${TSTAMP}" />

   <target name="checkout" depends="init,do-checkout" 
     <tstamp />
     <echo message="Finished Checkout - ${DSTAMP} ${TSTAMP}" />

   <target name="compile" depends="init,do-compile" 
     <tstamp />
     <echo message="Finished Compile - ${DSTAMP} ${TSTAMP}" />

What do y'all think?

I'm willing to have a go at writing this if the idea meets with approval.


"Programming is an Art Form that Fights Back"

Bevan Arps (<>
Senior OO Analyst, ACT Financial Systems

This communication  is confidential  to ACT  Financial  Systems  (Asia 
Pacific)  and is intended for  use only by the  addressee.   The  views and 
opinions  expressed in  this email  are the senders  own and do not 
represent  the  views  and  opinions of  ACT  Financial  Systems  (Asia 

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message