> From: Stefan Bodewig [mailto:[EMAIL PROTECTED]
> 
> > Should be trivial to add a 'resource' attribute, no?
> 
> <antlib> can contain <typedef> which in turn supports resource.  This
> should work right now, shouldn't it?

Indeed it works, as demonstrated below. Cool! Thanks Stefan and Peter ;-)

I'm just starting to grasp the implications of the new features in Ant 1.6,
and man, are they cool!!! A big thank you to Peter for getting them thru!
Yes, I disagree with some of the choices, and even wrote so in the Wiki, but
overall, it's a lot more power and flexibility, and I'll use them ;-) --DD

PS: Below, my latest Hack for a conditional Path, with namespace support:

C:\buildtools>ant -f conditional-path.xml
Buildfile: conditional-path.xml

test:
[bm:echopath] path = C:\oss\org_apache\antx\buildtools
[bm:echopath]        C:\oss\org_apache\antx

BUILD SUCCESSFUL
Total time: 1 second
C:\buildtools>ant -f conditional-path.xml -Dimport61=true
Buildfile: conditional-path.xml

test:
[bm:echopath] path = C:\oss\org_apache\antx\buildtools
[bm:echopath]        C:\oss\org_apache\antx
[bm:echopath]        C:\oss\org_apache\antx\import61
[bm:echopath]        C:\oss\org_apache\antx\import61\config

BUILD SUCCESSFUL
Total time: 1 second
C:\buildtools>type conditional-path.xml
<project name="antx" default="test"
         xmlns:bm="antlib:com.lgc.buildmagic">

  <target name="test">
    <bm:conditional-path id="path">
      <element location="." />
      <element location=".." />
      <element location="../.." if="pp" />
      <element location="../../.." ifTrue="${ppp}" />
      <elementgroup ifTrue="${import61}">
        <element location="../import61" />
        <element location="../import61/config" />
      </elementgroup>
    </bm:conditional-path>

    <property name="path" refid="path" />
    <bm:echopath pathref="path" />
  </target>

</project>

C:\buildtools>type ...\buildmagic\src\com\lgc\buildmagic\antlib.xml
<?xml version="1.0"?>

<antlib>

  <taskdef resource="com/lgc/buildmagic/tasks.properties" />
  <typedef resource="com/lgc/buildmagic/types.properties" />

</antlib>

(the antlib.xml file above is packaged in the buildmagic.jar file,
 which is itself in ant/lib, to be automatically loaded thru the
 name antlib:package-name trick).

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

Reply via email to