ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Stillwell <Chris.Stillw...@wcom.com>
Subject RE: un(jar/war/zip) & filesets...
Date Thu, 15 Mar 2001 17:08:08 GMT
Dennis,

This is already handled with zipfileset, like this:

<zipfileset src="${jini_home}/sun-util.jar"
includes="com\sun\jini\admin\DestroyAdmin.class"/>

Chris Stillwell

-----Original Message-----
From: Dennis Brake [mailto:dbrake@globalinfotek.com]
Sent: Thursday, March 15, 2001 9:52 AM
To: 'ant-user@jakarta.apache.org'
Subject: RE: un(jar/war/zip) & filesets...


I haven't followed all of this thread so I don't know if my needs
are the same as Julian's. What I would like to see is a way to
extract files (that match a pattern) from a zip/jar file.

We are developing jini code and there is a class in one of sun's
jar files that needs to be extracted and copied to a development
directory. The way I do it now is to create a temp directory, unzip
the file to this directory, copy the single file that I need to my
development tree, and delete the temp directory. For example,

    <mkdir   dir="${project.temp}" />
    <unjar src="${java.jini}/lib/jini-ext.jar" dest="${project.temp}" />
    <copy todir="${project.output}">
        <fileset dir="${project.temp}">
           <include name="net/jini/lookup/*_Stub.class" />
        </fileset>
    </copy>
    <delete  dir="${project.temp}" />

I think a good general solution that would solve my problem, and
possibly others, would be to extend the fileset to allow zip/jar
to be added either as a dir or with another property (e.g. zip).
So my above tasks could be reduced to:

    <copy todir="${project.output}">
        <fileset dir="{java.jini}/lib/jini-ext.jar">
           <include name="net/jini/lookup/*_Stub.class" />
        </fileset>
    </copy>
or

    <copy todir="${project.output}">
        <fileset zip="{java.jini}/lib/jini-ext.jar">
           <include name="net/jini/lookup/*_Stub.class" />
        </fileset>
    </copy>

> -----Original Message-----
> From: Stefan Bodewig [mailto:bodewig@apache.org]
> Sent: Thursday, March 15, 2001 9:18 AM
> To: ant-user@jakarta.apache.org
> Subject: Re: un(jar/war/zip) & filesets...
>
>
> Julian gosnell <Julian.Gosnell@ubsw.com> wrote:
>
> > I have played a little bit with zipfileset and found the mention of
> > it in the 1.3 documentation. Unfortunately it's not going to do what
> > I want.
> >
> > It is treating one zipfile as a fileset
>
> Yes, this is what it does. I thought you could get away with
> explicitly listing the zipfiles you need to read from for your <jar>
> task. As this is not the case ... no there currently is no way to
> achieve what you want, sorry.
>
> Stefan
>


Mime
View raw message