ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Zander <zan...@planescape.com>
Subject [PATCH] extending the Dirname task
Date Sun, 07 Jul 2002 17:43:18 GMT
Hi,

in my company we use one large sourcetree for several different end-products. A
number of packages are shared between these products and lots are not.

Since I don't want to have a huge jar containing way to much, I want to have
several jars named after the products containing only the needed packages for
that product.

I needed a way to select the package name from a fileset where the fileset
was something like:
    <fileset dir="${src}" id="projectlist">
        <and>
            <filename name="**/.jars" />
            <contains text="myproject" />
        </and>
    </fileset>

This returns a number of files, all of which are named .jars and contain the
the text "myproject". 
Now I want to find out which classes live in the same dir as that file.  I 
can't find a way in ant to do this, so I added a number of properties to the
<dirname> task. To select all classes just type:

    <dirname basedir="." property="packagefiles" separator="/*.class, ">
        <fileset refid="projectlist" />
    </dirname>

    <apply executable="ls" dir="${buildzone}">
        <fileset dir="${buildzone}" includes="${packagefiles}/*.class" />
    </apply>


Please consider adding the patch to the main distribution.
Thanx!

-- 
Thomas Zander                                           zander@planescape.com
                                                 We are what we pretend to be

Mime
View raw message