ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject RE: Removing a file from .jar file
Date Fri, 05 May 2006 18:28:30 GMT
--- "Burgess, Benjamin" <BBurgess@tiaa-cref.org>
wrote:

> Correct me if I am wrong,

Okay... ;)

> but I believe that in Ant
> 1.7 you will be able
> to do this because the delete task will allow any
> resource, such as a
> file in an archive.
> 
It'd be nice, but <delete> is one of those tasks that
is so
what-kind-of-resource-are-we-talking-about-specific
that, at present, anyway, it handles only filesystem
resources.  First sentence from the manual page:

Deletes a single file, a specified directory and all
its files and subdirectories, or a set of files
specified by one or more resource collections.

Sorry for any confusion here.  :)

-Matt

> Ben
> 
> -----Original Message-----
> From: Jan.Materne@rzf.fin-nrw.de
> [mailto:Jan.Materne@rzf.fin-nrw.de] 
> Sent: Friday, May 05, 2006 10:20 AM
> To: user@ant.apache.org
> Subject: AW: Removing a file from .jar file
> 
> >I don't think you can delete the class file...but
> you can 
> >certainly update the jar file with a new class or
> modified 
> >class.  To delete, you will probably need to unjar,
> delete the 
> >file in question and rejar...
> >
> >Leomar Costa wrote:
> >>     Hi !
> >>
> >>     How I can remove a file from a jar ? 
> 
> 
> 
> I dont know another way neither ... 
> but you could define a macro for that.
> 
> 
> Jan
> 
> 
> <project default="test">
> 
>     <target name="prepare">
>         <mkdir dir="zip"/>
>         <echo file="zip/one.txt"   message="one"/>
>         <echo file="zip/two.txt"   message="two"/>
>         <echo file="zip/three.txt" message="three"/>
>         <zip destfile="zip.zip" basedir="zip"/>
>         <delete dir="zip"/>
>     </target>
> 
> 
>     <macrodef name="delFromZip">
>         <attribute name="zip"/>
>         <element   name="selectors" implicit="true"
> optional="true"/>
>         <sequential>
>             <mkdir dir="__tmp__"/>
>             <unzip dest="__tmp__" src="@{zip}"/>
>             <delete file="@{zip}"/>
>             <delete>
>                 <fileset dir="__tmp__">
>                     <selectors/>
>                 </fileset>
>             </delete>
>             <zip destfile="@{zip}"
> basedir="__tmp__"/>
>             <delete dir="__tmp__"/>
>         </sequential>
>     </macrodef>
> 
> 
>     <target name="test" depends="prepare">
>         <delFromZip zip="zip.zip">
>             <include name="two.*"/> 
>         </delFromZip>
>     </target>
> 
> </project>
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 
> 
>
**************************************************************
> This message, including any attachments, contains
> confidential information intended for a specific
> individual and purpose, and is protected by law.  If
> you are not the intended recipient, please contact
> sender immediately by reply e-mail and destroy all
> copies.  You are hereby notified that any
> disclosure, copying, or distribution of this
> message, or the taking of any action based on it, is
> strictly prohibited.
> TIAA-CREF
>
**************************************************************
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message