--- Dominique Devienne <[EMAIL PROTECTED]> wrote:

> On 8/31/06, Matt Benson <[EMAIL PROTECTED]>
> wrote:
> > DD, what was that task you had for doing something
> > with references at a different time than Ant
> normally
> > would?  Seems like it is attached to a BZ issue
> > someplace...  Do you know what I'm talking about?
> 
> Yes, it's called <reference>, and is indeed attached
> somewhere in BZ.
> It postpones adding the reference to runtime instead
> of parse time.
> Additionally, the reference ID is not a string
> litteral, but a
> property-expanded string.
> 
> > All: shouldn't Ant have an e.g. <refcopy> task?
> 
> I'm not following at all this discussion of
> <refcopy> ;-)
> Would you have a more concrete use case? --DD

See
http://issues.apache.org/bugzilla/show_bug.cgi?id=27118
.  In an example here,

a.xml:
<project name="a">
  <selector id="sel">
    <filename name="**/*.txt" />
  </selector>
</project>

b.xml:
<project name="b">
  <import file="a.xml" />
  <!--
  Here you want to redefine "sel", incorporating its
current definition, whatever that may be.  How do you
do it?
  -->
</project>

In the commented zone above, the following creates a
circular reference:

<selector id="sel">
  <and>
    <selector refid="sel" />
    <contains text="foo" />
  </and>
</selector>

This doesn't yield the desired result either:

<selector id="_sel">
  <and>
    <selector refid="sel" />
    <contains text="foo" />
  </and>
</selector>

<selector id="sel" refid="_sel" />

You should still get a circular reference because of
the way references are resolved.  The only way is:

<copyref refid="sel" to="a.sel" />
<!-- yes, I changed the name -->

<selector id="sel">
  <and>
    <selector refid="a.sel" />
    <contains text="foo" />
  </and>
</selector>

Is there another way, without code (I know, code is
not necessarily the most evil thing in the world...)?

-Matt

> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to