ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: nested property references
Date Sat, 28 Apr 2001 02:13:55 GMT
At 05:46  27/4/01 +0200, Rob van Oostrum wrote:
>- I agree that it is possible that you can work around not having nested
>property suppport. But I do consider it a workaround. Giving me a
>workaround IMHO does not constitute an argument why the feature itself
>is not needed.

While I don't consider it a "workaround" as such I suspect what you want
will be provided in ant via use of templates. You can also do what you want
inside ant via use of split-join pattern that has been described a number
of times in the ant build file.

>- I think that for all practical purposes Ant should either support
>nested property references, or it *shouldn't* support setting them (as
>in using a property reference in setting the name of a property). The
>latter currently works, but it's a useless feature, since you'll never
>be able to reference it using the property reference in the property
>name. Ant should either do it right, or not at all.

Actually it is currently used in a few places - example includes split-join
pattern mentioned above. ie

<target name="do-blah" depends="do-blah-x,do-blah-y,do-blah-z" />

<target name="do-blah-x" depends="setup-do-blah" if="do.blah.x" />
<target name="do-blah-y" depends="setup-do-blah" if="do.blah.y" />
<target name="do-blah-z" depends="setup-do-blah" if="do.blah.z" />

<target name="setup-do-blah">
  <property name="do.blah.${flavor}" value="true" />
</target>

>So I think it's just a much more elegant way of setting things up. If
>not for any immediate need, I would like to see it in there for the sake
>of implementing property references properly. We can go back and forth
>with examples of what I'd like to use the functionality for, and how we
>can bend over backwards to (mis-) use other functionality, but as I
>stated previously, I think this is only a workaround. More than new
>functionality, it's just something that IMHO should have been supported
>from the start. I know writing recursive code gets really complex really
>fast. But there must be enough people in the dev community that are able
>to fork this out without breaking a sweat. If someone points me in the
>right direction (where are property refs implemented at the moment? ...)
>I'll do the coding myself.

It has been coded before - wasn't accepted then - probably won't be now
either ;) Theres a lot of things that *could* be done - we don't to keep
simplicity - it is a design choice. What you are doing is trying to
integrate autoconf-like functionality into ant which is something we
decided we don't want to support (should be a different tool).

>Also: a point about references to non-existing properties. I think those
>should always generate errors (which they don't, it just causes the
>property reference to be used unresolved, which looks very ugly to me).

true - that will change in Ant2. This "feature" is there for backwards
compatability.

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


Mime
View raw message