ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Stevens <>
Subject Re: Extending path
Date Thu, 10 Jun 2010 17:58:45 GMT
> I think you've later seen that you don't since all the attributes of the
> <file> are available via <sfile> as well.  Using Ant 1.8.0 you can even
> do a to get access to the
> instance itself.
> Yep, absolutely.  That's why I suggested tagging a whole resource
> collection later in my post.

This is the syntax that I'm looking to achieve:

    <spath id="filelist.classpath">
        <sfilelist dir="${lib.dir}">
            <sfile name="${ant.jar}" scope="compile" />
            <sfile name="svntask.jar" src="/path/to/svntask-src.jar"
scope="runtime" />
        <sfilelist dir="${target.dir}">
            <sfile name="sweetened.jar"
src="/path/to/sweetened-src.jar" scope="runtime" />
        <sfilelist dir="${alexandria.dir}">
            <sfile name="${junit.jar}" scope="compile" />

    <spath id="javac.classpath" refid="filelist.classpath" scope="compile" />

Ideally, I could then do something like this:

<javac><classpath refid="javac.classpath" /></javac>

and only the jar files (defined via <sfile> instances) that are marked
with scope="compile" will get passed to the javac task.

I've changed <spath> to extend Union and that is working fine. The
problem I'm having now is that when I echo out the javac.classpath:


the getCollection() method on my spath element is called. However, the
scope attribute on the spath is null. (ie: I've overrided
getCollection() and this.scope is null). I'm not sure why this is
getting nulled out.

Also, I really can't use 1.8 features... as much as I'd like to, these
build files must be able to run from within eclipse.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message