Err, I'm not entirely new to ant, but I don't understand how to use this. Any 
further explanation would be appreciated!

<addpath topath="project.class.basepath">
        <nested>
      ...
      </nested>
</addpath>

-----Original Message-----
From: jan.mate...@rzf.fin-nrw.de [mailto:jan.mate...@rzf.fin-nrw.de] 
Sent: Friday, January 29, 2010 12:38 AM
To: user@ant.apache.org
Subject: AW: Add new resource to existing ResourceCollection (path) in ANT 
build script

I have an implementation for <path>s: copy to a temporary and then 'rename'

    <macrodef name="addpath">
        <attribute name="topath"/>
        <element name="nested" optional="yes" implicit="true"/>
        <sequential>
            <path id="tmp">
              <pathelement path="${toString:@{topath}}"/>
              <nested/>
            </path>
            <path id="@{topath}"><pathelement path="${toString:tmp}"/></path>
            <path id="tmp"/>
        </sequential>
    </macrodef>


Jan 

>-----Ursprüngliche Nachricht-----
>Von: Matt Benson [mailto:gudnabr...@gmail.com] 
>Gesendet: Donnerstag, 28. Januar 2010 19:48
>An: Ant Users List
>Betreff: Re: Add new resource to existing ResourceCollection 
>(path) in ANT build script
>
>
>On Jan 28, 2010, at 12:21 PM, Dan Beaulieu wrote:
>
>>
>>
>> I've got a build script that builds multiple components and 
>jars them 
>> up. I currently build a path like so:
>>
>> <path id="project.class.basepath">
>>     <fileset dir="${lib.dir}">
>>         <include name="**/*.jar" />
>>     </fileset>
>>   <fileset dir="${path.to.base}/components">
>>         <include name="*/build/lib/*.jar" />
>>     </fileset>
>> </path>
>>
>> And this gets called before every compile target. So every time, its 
>> loading everything in the /lib dir and then scanning all of the 
>> components for jars.
>>
>> I'd like to just add to this path after I jar each component, So I'd
>> have:
>>
>> <jar....>
>> .
>> .
>> </jar>
>> <path id="project.class.basepath">
>>     <path refid="project.class.basepath"/>
>>     <fileset dir="${path.to.base}/components/${component}">
>>         <include name="*${build.dir}/lib/*.jar" />
>>     </fileset>
>> </path>
>>
>> But that doesn't work, with circular dependency failures.
>>
>> I also tried make a temp path with a different name first, but that 
>> did not work either with the same message.
>>
>> My main problem doing it as I currently am, is it's scanning all of 
>> the components (27 of them) every time for jars, when I really only 
>> want to add in the last one we just built, and I know when and where 
>> we are doing it so why not there?
>>
>> Anyway to update a path reference instead of stomping it and 
>> rebuilding it completely?
>
>I would think the correct way to do this would be to design a 
>task that would use Ant's built-in facilities to augment a given ref  
>object with attributes and nested elements, but such is not trivial.   
>In the meantime you could/should probably script something like this.
>
>HTH,
>Matt
>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For 
>additional 
>> commands, e-mail: user-h...@ant.apache.org
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For 
>additional commands, e-mail: user-h...@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org

Reply via email to