ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wascally Wabbit <>
Subject Re: local properties (what about PropertyHelper?)
Date Fri, 08 Oct 2004 15:49:43 GMT
QUESTIONS ON PropertyHelper (Ant 1.6+) ANT-dev mailing list:

o Should PropertyHelper replacements honor currently attached
   hooks? What if a hook is attached and then the helper is
   unset (reset to the original Ant-installed one?) Should the
   (new) hooks be "moved" to the original helper?

o Can we create a formal method that gets/sets propertyHelper w/o
   generating reference-replacement warnings?

o What's the ant-dev position on recursive property resolution?
   Is it coming or is that value-added that one must put in one's
   own tasks?

o How do we propagate replaced helpers to sub-projects? What
   about sub-builds?

[NEW} Sooo how would custom PropertyHelpers and Hooks work with
   the selected <local> proposals?

The Wabbit

At 05:36 AM 10/8/2004, you wrote:
>I have had a proposal outstanding for a while for local properties:
>I would like to see them included in ant.
>There has been a (lot) of discussions - see
>My current feelings (and implemenation) is
>1) Syntax
>The proposal adds a local property to a enclosing target/taskcontainer.
>   <target name="example">
>       <local name="prop" value="a local value"/>
>       <echo>prop is ${prop}</echo>
>   </target>
>   <macrodef name="t2">
>       <attribute name="file"/>
>       <sequential>
>         <local name="dir"/>
>         <dirname property="dir" file="@{file}"/>
>         <mkdir dir="${dir}"/>
>         <touch file="@{file}"/>
>       </sequential>
>    </macrodef>
>I think it is nicer to do this rather that having an explicit local
>property container, or having special elements for different types
>of structures (like for example a <local> element at the same level
>as <attribute> in a <macrodef>).
>2) Shadowing of properties
>The proposal allows local properties to shadow normal and user properties.
>I feel that this is necessary to allow macrodefs to be written without
>them failing sometimes. This means that the following will work:
>  <import file="macros.xml"/>
>  <property name="dir" value="."/>
>  <t2 file="${user.home}/.ant/lib/js.jar"/>
>ant -Ddir=/var/tmp
>3) Extent of local properties
>local properties will be inherited to child projects (if inheritall is true).
>Stephan Bodewig wrote:
>>Things we need to consider IMHO:
>>(1) Syntax
>>Your proposal uses a <local> task that sets up a local scope for a
>>named property until the enclosing target/sequential finishes.  Jose
>>Alberto suggested to use a <local> TaskContainer instead, something
>>  <local-property name="...."/>
>>which would essentially just add an explicit (and differently named)
>><seqential> to your proposal.  I think I prefer the more explicit,
>>even if more verbose syntax of the second form.
>>(2) Shadowing of properties
>>Your updated proposal ensures that local properties do not override
>>"global" user properties.  I think they shouldn't be allowed to
>>override any outer scope properties at all.
>>(3) Extent of local properties
>>You make the local properties available to <script> - will they also
>>be available for builds that get called with the <ant> family of tasks
>>(assuming inheritall is true)?  I think they should be.

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

View raw message