Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / February 2004

Tip: Looking for answers? Try searching our database.

Ant and zipping One directory.

Thread view: 
Son KwonNam - 02 Feb 2004 10:02 GMT
I have a project that has the following directory structure.
PROJECTHOME/
  build.xml
  src/
  bin/
  lib/
  deploy/
     apidoc/
     my.jar
  dir1/
  dir2/
  dir3/
  more dirs....

I just want to zip apidoc/, my.jar, src/. so the Zip file has the
following structure.

* my.zip
   apidoc/
   my.jar
   src/

My build.xml includes...
---------
    <target name="zip" depends="javadoc,makejar">
        <zip destfile="deploy/datectool.zip">
            <fileset dir="deploy/">
                <exclude name="datectool.zip"/>
            </fileset>
        </zip>
---------

But the problem is I cannot zip src/. I tried a lot, but couldn't.
I tried <fileset dir="src/"/> but It include only the contents for src/.
It did not make src/ in the zip file.

Thanks for reading.
David Rabinowitz - 02 Feb 2004 12:38 GMT
Try <zipfileset>. See http://ant.apache.org/manual/CoreTasks/zip.html

> I have a project that has the following directory structure.
> PROJECTHOME/
[quoted text clipped - 33 lines]
>
> Thanks for reading.
Son KwonNam - 03 Feb 2004 00:45 GMT
Thanks.
I tried the following and got the result that I exactly expected!!

<zip destfile="deploy/test.zip">
    <zipfileset dir="src" prefix="src"/>
    <zipfileset dir="deploy/apidoc" prefix="apidoc"/>
    <zipfileset dir="deploy/dist" prefix="dist"/>
</zip>

David Rabinowitz ? ?:
> Try <zipfileset>. See http://ant.apache.org/manual/CoreTasks/zip.html
>
[quoted text clipped - 35 lines]
>>
>> Thanks for reading.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.