Class Rake::PackageTask
In: lib/rake/packagetask.rb
Parent: TaskLib

Create a packaging task that will package the project into distributable files (e.g zip archive or tar files).

The PackageTask will create the following targets:

+:package+ :Create all the requested package files.
+:clobber_package+ :Delete all the package files. This target is automatically added to the main clobber target.
+:repackage+ :Rebuild the package files from scratch, even if they are not out of date.
"package_dir/name-version.tgz" :Create a gzipped tar package (if need_tar is true).
"package_dir/name-version.tar.gz" :Create a gzipped tar package (if need_tar_gz is true).
"package_dir/name-version.tar.bz2" :Create a bzip2‘d tar package (if need_tar_bz2 is true).
"package_dir/name-version.zip" :Create a zip package archive (if need_zip is true).

Example:

  Rake::PackageTask.new("rake", "1.2.3") do |p|
    p.need_tar = true
    p.package_files.include("lib/**/*.rb")
  end

Methods

Attributes

name  [RW]  Name of the package (from the GEM Spec).
need_tar  [RW]  True if a gzipped tar file (tgz) should be produced (default is false).
need_tar_bz2  [RW]  True if a bzip2‘d tar file (tar.bz2) should be produced (default is false).
need_tar_gz  [RW]  True if a gzipped tar file (tar.gz) should be produced (default is false).
need_tar_xz  [RW]  True if a xz‘d tar file (tar.xz) should be produced (default is false)
need_zip  [RW]  True if a zip file should be produced (default is false)
package_dir  [RW]  Directory used to store the package files (default is ‘pkg’).
package_files  [RW]  List of files to be included in the package.
tar_command  [RW]  Tar command for gzipped or bzip2ed archives. The default is ‘tar’.
version  [RW]  Version of the package (e.g. ‘1.3.2’).
without_parent_dir  [RW]  True if parent directory should be omited (default is false)
zip_command  [RW]  Zip command for zipped archives. The default is ‘zip’.

Public Class methods

Create a Package Task with the given name and version. Use +:noversion+ as the version to build a package without a version or to provide a fully-versioned package name.

Public Instance methods

Create the tasks defined by this task library.

Initialization that bypasses the "yield self" and "define" step.

The directory this package will be built in

The name of this package

The package name with .tar.bz2 added

The package name with .tar.gz added

The package name with .tar.xz added

target directory relative to working_dir

The package name with .tgz added

The package name with .zip added

[Validate]