Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 12880 invoked from network); 8 Aug 2007 14:09:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Aug 2007 14:09:58 -0000 Received: (qmail 61448 invoked by uid 500); 8 Aug 2007 14:09:57 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 61128 invoked by uid 500); 8 Aug 2007 14:09:56 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 61114 invoked by uid 99); 8 Aug 2007 14:09:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Aug 2007 07:09:56 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of zhouyuehong@21cn.com designates 59.36.102.60 as permitted sender) Received: from [59.36.102.60] (HELO 21cn.com) (59.36.102.60) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Aug 2007 14:09:47 +0000 HMM_SOURCE_IP: 10.27.2.1:42160.40160023 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from 21cn.com (dgproxy1.inner-hermes.com [10.27.2.1]) by 21cn.com (HERMES) with ESMTP id 9FB0F3800D for ; Wed, 8 Aug 2007 22:16:08 +0800 (CST) Received: from aisp1-smtp (unknown [202.105.45.9]) by 21cn.com (HERMES) with ESMTP for ; Wed, 8 Aug 2007 22:16:08 +0800 (CST) Received: from 127.0.0.1([58.100.46.194]) by aisp1-smtp(Knowledge-based Antispam Gateway 2.125g11b) with ESMTP id local26910.1186581037 for ; Wed Aug 8 21:50:41 2007 +0800 X-Original-AuthLogin: zhouyuehong@21cn.com Date: Wed, 08 Aug 2007 22:09:21 +0800 From: Michael Zhou To: "Ant Developers List" Subject: Re: Contribute: use zipfileset to extract sub-path of zips In-Reply-To: References: <20070808151309.0C72.ZHOUYUEHONG@21cn.com> Message-Id: <20070808213928.EF84.ZHOUYUEHONG@21cn.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.31 [en] X-Virus-Checked: Checked by ClamAV on apache.org Thank you for your reply. Yes, I can use unzip task to do the similar things, but my improved zipfileset is more convenient and faster than simply unzip, copy and re-pack approaches. I usually need to merge some WAR files into one big WAR -- to save memories, resources of app-server, and each war represents a sub-dir of the big WAR. But we need to keep the WEB-INF and META-INF dirs top level. Of course we can unzip all WARs and re-pack them into new one, but it's much faster to use this new zipfileset to generate it all at once. Hopefully it is useful to other people. > Why bother to go through all that when you can just unzip the file in your > copy case? > > ____________________________________________________________________________________________ > > Jeffrey E. (Jeff) Care > carej@us.ibm.com > IBM WebSphere Application Server > Systems Management Tools Architecture & Development > > > > > > Michael Zhou wrote on 08/08/2007 04:38:31 AM: > > > I used to build a jar file (or any zip-format file: war, ear, etc.), > > which contents are extracted from other zip files. For instance, > > zip file src.zip contains: > > > > +---main > > | \---org > > | \---apache > > | Test.java > > | > > \---test > > > > I just want the subtree under "main" (not include main directory) to be > > packed into my jar file: > > > > +---org > > \---apache > > Test.java > > > > So I wrote a build.xml to do this: > > > > > > > > > > > > > > > > > > > > But the result is not as expected: > > > > +---main // I don't want this directory here > > \---org > > \---apache > > Test.java > > > > In order to take off the "main" directory, I modified some Ant classes. > > Attachment is the patch file from Ant 1.7.0 source. > > > > Usage: > > > > > > > > > > > > > > > > > > > > > > This is not the best solution I think. Because it doesn't support tasks > > other than "zip", "jar", "war". For example, the following build script > > won't work: > > > > > > > > > > > > > > > > > > > > I suggest to improve class org.apache.tools.zip.ZipFile to support new > zip > > file format like "src.zip!/main". By this way, any tasks use zipfileset > > do not need to be changed. > > > > For example, > > > > > > > > > > > > > > > > > > > > Michael Zhou > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > > For additional commands, e-mail: dev-help@ant.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org > -- Michael Zhou --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org