Search in sources :

Example 1 with Zip

use of org.apache.tools.ant.taskdefs.Zip in project intellij-community by JetBrains.

the class ZipContainer method createTask.

protected Zip createTask() {
    Zip task = new Zip();
    task.setTaskName("zip");
    return task;
}
Also used : Zip(org.apache.tools.ant.taskdefs.Zip)

Example 2 with Zip

use of org.apache.tools.ant.taskdefs.Zip in project JessMA by ldcsaa.

the class Zipper method getTask.

/** 获取压缩任务对象 */
@Override
protected Task getTask() {
    Project project = new Project();
    Zip zip = new Zip();
    FileSet src = getSourceFileSet();
    src.setProject(project);
    zip.setProject(project);
    zip.setDestFile(getTargetFile());
    zip.addFileset(src);
    if (encoding != null)
        zip.setEncoding(encoding);
    if (comment != null)
        zip.setComment(comment);
    return zip;
}
Also used : Zip(org.apache.tools.ant.taskdefs.Zip) Project(org.apache.tools.ant.Project) FileSet(org.apache.tools.ant.types.FileSet)

Example 3 with Zip

use of org.apache.tools.ant.taskdefs.Zip in project gradle by gradle.

the class TestFile method createZip.

public TestFile createZip(Object path) {
    Zip zip = new Zip();
    zip.setWhenempty((Zip.WhenEmpty) Zip.WhenEmpty.getInstance(Zip.WhenEmpty.class, "create"));
    TestFile zipFile = file(path);
    zip.setDestFile(zipFile);
    zip.setBasedir(this);
    zip.setExcludes("**");
    zip.setProject(new Project());
    zip.execute();
    return zipFile;
}
Also used : Zip(org.apache.tools.ant.taskdefs.Zip) Project(org.apache.tools.ant.Project)

Example 4 with Zip

use of org.apache.tools.ant.taskdefs.Zip in project adempiere by adempiere.

the class CreateZipFile method zipFolder.

/**
	* Zip the srcFolder into the destFileZipFile. All the folder subtree of the src folder is added to the destZipFile
	* archive.
	* 
	*
	* @param srcFolder File, the path of the srcFolder
	* @param destZipFile File, the path of the destination zipFile. This file will be created or erased.
	*/
public static void zipFolder(File srcFolder, File destZipFile, String includesdir) {
    Zip zipper = new Zip();
    zipper.setDestFile(destZipFile);
    zipper.setBasedir(srcFolder);
    zipper.setIncludes(includesdir);
    zipper.setUpdate(true);
    zipper.setCompress(true);
    zipper.setCaseSensitive(false);
    zipper.setFilesonly(false);
    zipper.setTaskName("zip");
    zipper.setTaskType("zip");
    zipper.setProject(new Project());
    zipper.setOwningTarget(new Target());
    zipper.execute();
    System.out.println(destZipFile);
}
Also used : GZip(org.apache.tools.ant.taskdefs.GZip) Zip(org.apache.tools.ant.taskdefs.Zip) Project(org.apache.tools.ant.Project) Target(org.apache.tools.ant.Target)

Aggregations

Zip (org.apache.tools.ant.taskdefs.Zip)4 Project (org.apache.tools.ant.Project)3 Target (org.apache.tools.ant.Target)1 GZip (org.apache.tools.ant.taskdefs.GZip)1 FileSet (org.apache.tools.ant.types.FileSet)1