ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <j_a_fernan...@yahoo.com>
Subject RE: [DISC] passing properties to subbuilds
Date Wed, 13 Jun 2001 09:47:23 GMT
> From: Stefan Bodewig [mailto:bodewig@apache.org]
>
> Jose Alberto's approach (as I've understood it):
>
> All properties get passed to the sub build.
>
> All <property> tasks override existing properties unless these come
> from command lines or <param> tags nested into <ant> - with one
> exception: you can say that you are just giving a default value for a
> property that should not be used if that property already exists.
>
> I see a problem with Jose Alberto's approach as it is sure going to
> break Ant1 build files that hold multiple definitions of properties
> and rely on the fact, that only the first definition will win (Ant's
> own build file for example uses a property file to override
> build.compiler settings if the user wants to).
>

This is not exactly what I had in mind. <property> only overrides those
properties that were not defined locally. So, once the property is defined
locally once, it cannot be changed, just as we have today. Remember I one
big supported of inmutability :-).

The default mechanism, allows you to tell <property> to make a non-locally
defined value, local (as the default). Once this is done the property is
considered to be locally defined and hence it cannot be changed.

> I'd prefer to have explicit control over what I'm going to
> pass down to
> the sub build, so I prefer Conor's approach.
>

What I tried to accomodate with my definition was the case, pointed out by
Diane, of the ${debug} property to control debug mode on <javac>. Until we
have preferences, people want to have some properties that they do not
really want to manage explicitly all over the build but they want to be able
to modify and to get global effect.

With my approach, each build file would have something like:

	<property name="debug" default="debug" />
	<property name="debug" value="false"/>

if debug is already defined, its value would have been made local (and be
fixed) otherwise if will get the value "false" in the local environment. Of
course the actual sysntax if up for discussion.

Jose Alberto

> Stefan
>


Mime
View raw message