ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Louis Boudart <>
Subject Augment feature
Date Tue, 06 Apr 2010 15:16:07 GMT
I think the idea of implementing an augment features (idea initiated by Matt
Benson as described in the
previous thread)  make sense.
This idea was to provide a task that allows augmentation of previously
declared references.
There is many places where it can be useful, and as far as i know nobody was
opposed on the main idea.

By the way there was one point still in discussion lost in the whole thread.
Many person was in favor of an opt-in approach to keep backward
I guess, you can only use <augment> feature on references that as been
designed for extention (by adding an argument like final="false" on the
reference for example).

Antoine Levy Lamber was highlighting that ant datatypes are currently
de-facto mutable by default. And maybe we were complexifying too much this

The objective of this thread is to take a decision on :

   - restriction on augment feature
   - and if the vote is in favor to choose one implementation design to do

So, What's your opinion ?
Should we introduce kind of restriction on the <augment> feature  (like
"final=false") ? Or should we keep this usable on ALL existing reference ?

If the answer is yes How would you like to we restrict this ?
   - by adding a new attribute (like final="false") on datatype ?
   - by adding magic properties ?
   - taking in consideration that taks and types are java objects, can we
reuse a java property "final" as a configuration attribute?
    Exemple:    private final String myProperty;
   - with another alternative ?

IMHO the augment feature can live without any restriction.
As highlighted by Antoine, with current code base "reference can be modified
by user developed ant tasks or script fragments."

But, it could make sense to provide a way to make reference unmutable. Doing
this a given reference cannot be modified by <augment> task (or by any user
developped ant task / script fragment).
For example :
    - if you design a target (or a datatype) used in a multithread context
you probably don't want to make it extensible (because it's gonna be a hell
to maintain).
    - if you are designing kind of generic build file, you may want to have
part of this generic stuff extensible but maybe you want to restrict
extension on some of your targets/datatypes that are deeply used internally.
Part of the generic script can be kind of "blackbox".

About implementation details, i would be in favor of adding a new attribute
to datatypes (like final="true"), cause it make it easy to understand /

Considering that current code base allow to modify any references and to
avoid any side effect, i suggest to make the make this restriction optional
I guess if you want to make a reference unmuttable you should set it
explicitly (with a final="true").

<!-- Example of an unmuttable reference -->
<myDataType id="my.reference" final="true"/>

In any case i really hope to use the <augment> feature soon in easyant :).

My 2 cents

Jean Louis Boudart
Independent consultant
Project Lead

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