views:

88

answers:

0

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>

I'd like to just add to this path when 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?