TarTask Class

Summary

Creates a tar file from the specified filesets.
Assembly
NAnt.Compression.dll
Namespace
NAnt.Compression.Tasks
Base Types
  • Task
graph BT Type-->Base0["Task"] Type["TarTask"] class Type type-node

Syntax

[TaskName("tar")]
public class TarTask : Task

Examples

Tar all files in ${build.dir} and ${doc.dir} into a file called "backup.tar.gz", and apply gzip compression to it.

    <tar destfile="backup.tar.gz" compression="GZip">
    <fileset basedir="${bin.dir}" prefix="bin">
        <include name="**/*" />
    </fileset>
    <fileset basedir="${doc.dir}" prefix="doc">
        <include name="**/*" />
    </fileset>
</tar>

Remarks

Uses #ziplib (SharpZipLib), an open source Tar/Zip/GZip library written entirely in C#.

Attributes

Type Description
TaskName

Properties

Name Value Summary
CompressionMethod TarCompressionMethod
The compression method. The default is NAnt.Compression.Types.TarCompressionMethod.None.
DestFile FileInfo
The tar file to create.
Flatten bool
Ignore directory structure of source directory, compress all files into a single directory. The default value is false.
IncludeEmptyDirs bool
Include empty directories in the generated tar file. The default is false.
TarFileSets TarFileSetCollection
The set of files to be included in the archive.

Methods

Name Value Summary
ExecuteTask() void
Creates the tar file.