The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

PANT::Zip - PANT support for zipping up files

SYNOPSIS

  use PANT;

  $zipper = Zip("foo.zip);
  $zipper->AddFile("test-thing", "thing");
  $zipper->AddTree("buildlib", "lib");
  $zipper->Compression(9);
  $zipper->Close();  

ABSTRACT

  This is part of a module to help construct automated build environments.
  This part is for help zipping up files.

DESCRIPTION

This module is part of a set to help run automated builds of a project and to produce a build log. This part is designed to provide support for zipping up files as needed.

It is really just a thin wrapping layer around Archive::Zip.

EXPORTS

None

METHODS

new($xml, "foo.zip");

Constructor for a test object. Requires an XML::Writer object and a zip name as parameters, which it will use for subsequent log construction. The PANT function ZIP calls this constructor with the current xml stream, and passes on the arguments for you. So normally you would call it via the accessor.

AddFile(file, newname)

Adds the given file to the zip, optionally renaming it on the way if a 2nd argument is given.

AddTree(directory, dirname, func)

Adds the given directory tree to the zip, recursively. If the newname is given, then the base directory will be renamed to that. Finally the 3rd parameter if present is a subroutine reference to be called for each prospective file. It can examine $_ and return true/false to add it.

Compression(no)

Set the overall archive compression number. This is a number between 0 and 9, 0 being no compression, and 9 being maximum compression.

SEE ALSO

Uses Archive::Zip for the zip operations. Makes use of XML::Writer to construct the build log.

AUTHOR

Julian Onions, <julianonions@yahoo.nospam-co.uk>

COPYRIGHT AND LICENSE

Copyright 2005 by Julian Onions

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.