ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: Adding magic properties for targets?
Date Wed, 04 Jun 2008 09:53:40 GMT
On Mon, 02 Jun 2008, Bruce Atherton <bruce@callenish.com> wrote:

> My problem with magic properties is that they pollute the namespace
> of allowed property names. Since properties are immutable, it can be
> confusing for someone to try to define a property for the first time
> in their build file and have it come back with an error about
> redefinition.

True.  We'd list them at
http://ant.apache.org/manual/using.html#built-in-props
of course.

> Your example about "dynamic" properties is interesting. I've always
> been in favoring of making properties immutable not by value but by
> meaning.

Well put, but a bit difficult to achieve.

> As another example, consider how we test for a file existing that
> could be created in several places throughout the build. We might
> have to use a separate property to test for existence in each
> section of the build: "file.exists", "file.exists.now",
> "file.exists.how.about.now", and then create complex conditions that
> combine all three properties into a single property. Much easier
> would be if we could assign the property directly to the existence
> of the file, and have it change over the lifetime of the build.

Some Resource-specialized PropertyHelper might work, something like
${resource:exists(*some-file-name*)}, but I'm not sure whether our
PropertyHelper infrastructure is really up to it.  In particular if
you think it a step further and want to read *some-file-name* from
another property.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message