ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: <macro> and XML NS hell ;-)
Date Tue, 24 Feb 2004 14:42:29 GMT
> From: Peter Reilly [mailto:peter.reilly@corvil.com]
> As regards the xml ns hell, I must agree - I still think that nested
> elements discovered through reflection should be in the ant core
> namespace as well as the namespace of the enclosing type/task.

Well, I'm not following, but I'm not surprised, as my head hurts when I try
to think at the issues related to XML NS handling in Ant...

> You are missing a bm prefix from a nested include of a fileset element in
> a bm:lsync (i think) element.

Not really, and this is where I think I may have stumbled on a possible bug
or flow of the current design...

Going back to the macro definition, simplified:

    <macrodef name="compile">
      <element name="sources" />  <!-- <<< Declaration -->
      <sequential>
        <javac ...>
          <sources/>              <!-- <<< Use in Javac - default NS -->
        </javac>
        <bm:sync ...>
          <fileset dir="src">
            <sources/>            <!-- <<< Use in lsync - BM NS -->
          </fileset>
        </bm:lsync>
      </sequential>
    </macrodef>

See how the macro element 'sources' is used in two different tasks, from two
different namespaces, the default/Ant NS, and my custom NS.

Apparently, it's currently impossible to use that same macro element in the
two places/tasks, when they are in different namespaces.

So is this a bug, design flaw, or user error???

And I can assure you all uses of the macro, as exemplified below, all have
the name attribute. This build has been working for weeks now, and I was
just trying to add the <sync> or <bm:lsync> additional step to it.

    <compile name="dsp-test-utils">
      <sources>
        <include name="com/lgc/testing/junitplus/**"/>
        <include name="com/lgc/testing/utils/**"/>
        <none>
          <contains text="import com.lgc.infra."/>
        </none>
      </sources>
    </compile>

    <compile name="dsp-util">
      <sources>
        <include name="com/lgc/java/**"/>
        <include name="com/lgc/javax/**"/>
      </sources>
    </compile>

> Also, is "sources" a typedef?

No, a macro element, as explained above. Please help. --DD

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


Mime
View raw message