ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@bigfoot.com
Subject using fileset to generate a list of directories
Date Thu, 13 Dec 2001 22:17:03 GMT

I'm trying to use ant's wildcard functions to add several directories
to a classpath.  It seems that the fileset operation finds only files,
and will not find directories.

More specifically, I'm working with a product which could have classes
installed in any number of "package" directories (in this product,
"package" does not refer to a Java package).  I want to include all
the classes directories in my classpath.  For instance, under the
product's main directory, I might have...

packages/A/code/classes/...
packages/B/code/classes/...
etc...

I tried using the following path tags to get all the classes directories

    <path id="packages.classpath">
        <!-- I wish this worked, but it doesn't -->
        <fileset dir="${server.home}">
            <include name="packages/**/code/classes"/>
        </fileset>
    </path>

But none of the directories are included in the path, because fileset
only finds files.  I know the fileset in general works, because each
package can also contain a code/jars/ directory, and the following
path does include all the .jar files found therein.

    <path id="packages.classpath">
        <!-- This does work -->
        <fileset dir="${server.home}">
            <include name="packages/**/code/jars/*.jar"/>
        </fileset>
    </path>


So, my question is, is there an easy way to find all my code/classes
directories?  Or do I have to explicitly list each one of them?  Is
FileSet designed to work this way?  Would it make sense to make a new
operation, DirectorySet?  Or add a parameter to FileSet,
i.e. includeDirectories="true"?

I'd appreciate if you CC dnc@bigfoot.com on any replies.

Thanks.

-Dave



--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message