ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Philion" <>
Subject RE: Some thoughts about runtime evaluation of properties
Date Tue, 25 Jul 2000 16:16:52 GMT
Laird -

If you've got mutable properties, and:

    <property name="lib.dir" value="${build.dir}/lib"/>

then you've got a few choices:
1) ${build.dir} will only be evaluated *once*, the first time, and if
the value of build.dir changes, lib.dir does not change.
2) ${build.dir} will be evaluated every time, so if build.dir changes,
so does lib.dir.
3) ${build.dir} will *cause* build.dir to become immutable, so you
don't have to worry about changing properties that depend on it.

1) is a problem because of possible consistency issues.

3) is a problem because of hidden side effects (properties become

So either 2), which is at least consistent, or immutable properties.

OR scoped semi-mutable properties, which can be reassigned within the
scope of a task (once), but which do not change the project
properties. To make this work, you still need to go with 2) above.

Further, if your project/task supports 2), then you can still make
properties immutable with minimal impact: Checking for existing
propertied in Project.

- Paul

> -----Original Message-----
> From: Nelson, Laird []
> Sent: Tuesday, July 25, 2000 12:00 PM
> To: ''
> Subject: RE: Some thoughts about runtime evaluation of properties
> > -----Original Message-----
> > From: Paul Philion []
> > I would really prefer to see properties, including ${},
> get evaluated
> > at runtime. I've been thinking about how that could be done.
> Sounds like GNU make's two assignment operators:
>   A=$(B)
> ...$(B) is evaluated anew each time $(A) is referenced, whereas:
>   A:=$(B)
> ...$(B) is evaluated once, when A is defined.  Is this a
> path ant should go
> down?
> Cheers,
> Laird

View raw message