Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
Zip file/folder only if present

Zip file/folder only if present

2007-06-26       - By Anderson, Rob (Global Trade)
Reply:     1     2     3     4  

I believe the zip task will not create a zip file if there are no files
to include.

-Rob Anderson

> -----Original Message-----
> From: Parag P. Doke [mailto:paragpdoke@(protected)]
> Sent: Monday, June 25, 2007 11:56 PM
> To: user@(protected)
> Subject: Zip file/folder only if present
>
> Hi All.
> I'm an ant newbie running version 1.7.0 on NTish Windows and
> Unix. My intent was to write a tiny build script that zips up
> certain files/folders if they are present. I was trying with
> the zip task and the zipfileset fileset with regexps.
> However, it seems like this works only if the referenced
> file/folder exists (else fails). Also, regexps do not seem to work.
>
> There is definitely the other option of running copy with
> failonerror set to false....but I thought of asking if
> someone knew how to use zipfileset without having to copy the
> contents.
>
> ParentFolder <- Fixed / known name
> |- Folder1/installer/logs <- Case of "Folder1" is uncertain
> |- FOLDER2/installer/logs <- Case of "FOLDER2" is uncertain (might not
> exist in each case - if the 2nd installer fails, this does not get
> created)
> |- installer/logs
> |- installOptions.htm <- Wish to zip up all *htm* files
>
> I am interested in using the prefix attribute of the zipfileset task.
> After unzipping, the files are created without the
> ParentFolder directory. Can someone share his/her experiences
> about the same ? An existing document explaining the process
> / logic will also be fine.
>
> Thanks in advance,
> --
> Parag P. Doke
> http://paragpdoke.blogspot.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected) For
> additional commands, e-mail: user-help@(protected)
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.