Class CreateZippedDirectoriesTask

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.aoapps.ant.tasks.CreateZippedDirectoriesTask
All Implemented Interfaces:
Cloneable

public class CreateZippedDirectoriesTask extends Task
Creates a ZIP file with a set of directories up to and including the given path. The timestamps for the directories will be taken from the provided ZIP file and path.

It is proving difficult to be able to introduce new directory into a ZIP file at build time in a reproducible way. If we set set <zip modificationtime="…"> we replace all meaningful timestamps. If we do not set it, newly added directories have current time. Cannot find any way with mappings, since directory-only mappings seem to be always ignored.

Use this task to create a small ZIP file containing only the needed new directories, then includes this new ZIP file as an additional <zipfileset />.

Author:
AO Industries, Inc.
  • Constructor Details

    • CreateZippedDirectoriesTask

      public CreateZippedDirectoriesTask()
  • Method Details

    • setReferenceZip

      public void setReferenceZip(String referenceZip)
      The ZIP file that will be referenced to get the timestamp.
    • setReferencePath

      public void setReferencePath(String referencePath)
      The path within the ZIP file that will be referenced to get the timestamp.
    • setGenerateZip

      public void setGenerateZip(String generateZip)
      The ZIP file that will be generated containing the given path and all parents, each with timestamps matching the reference.
    • setGeneratePath

      public void setGeneratePath(String generatePath)
      The path to generate in the ZIP file, including all parents, each with timestamps matching the reference.
    • execute

      public void execute() throws BuildException
      Overrides:
      execute in class Task
      Throws:
      BuildException