> From: Craeg K Strong [mailto:[EMAIL PROTECTED]
>
> One of the features of ant former make mavens may stumble over is the
> fact that
>  the properties of a parent project override those of a subproject
> invoked via the <ant> task.
> [Yes, I confess it has tripped me up a few times :-]
>
> However, sooner or later one recognizes the wisdom of this
> choice-- What
> happens
> when you download some open-source package with its own build
> file but
> want to
> change some of its properties.  For example, perhaps you need
> to change
> the output directory
> or turn on debugging.   Because we want "pristine sources" (a
> la Maximum
> RPM) we do NOT
> want to start hacking someone else's build file.  Instead, we
> externally
> specify our preferred property
> settings either on the command line (via -D) or using a
> simple "wrapper"
> buildfile.
>
> So far, so good-- but what about those times that you really WANT the
> subproject to override
> the property settings of the parent?   For example, one might
> set some
> defaults in a top level
> build file and then call multiple subproject buildfiles and override
> property settings when necessary.
> Is there a way to support this behavior and still keep analyzability,
> parallelizability, and all the other "-ilities"?
>

The proposal I have made in the past, which I think it is been consireder
for ANT2, is to allow properties to override unless:

 1) The new value is actually passed as pa <param> in the <ant*> call.

 2) Allow for the callee to specify that certain properties of that
buildfile may use a default value being set by a caller.

since in ANT one usually have a multiplicity of properties depending on one
another, and since names of properties may mean different things in
different buildfiles, the current behaviour results in having to manage a
global property name space that encompasses all buildfiles that you have on
the build. Which I think it does not allow for modularity at all.

> I believe so.  I am proposing adding a new attribute to the ant task
> where you would specify that
> all properties in the subproject should override those of the
> parent.
>  One possible name is
> "propertyprecedence," although I am looking for a better one!
>  It could
> take the values of
> "parent" and "child," and default to "parent" for example.
>

I think we need to deal with this at the core, instead of as just one
additional feature. Otherwise we will continue having inconsistencies all
over. At the end, we may still need to have a way to specify something like
what you are proposing, but for backward compatibility. But in that case,
the default would be the other way around.

> I hope I stated the problem clearly enough.  Do others agree with the
> need for this capability?
> If so, what are some alternative designs?
>

Yeap, I think we really need to discuss this issue and settle it on the ANT2
design.

Jose Alberto

Reply via email to