Search in sources :

Example 21 with Project

use of org.apache.tools.ant.Project in project adempiere by adempiere.

the class CreateZipFile method unpackFile.

public static void unpackFile(File zipFilepath, File destinationDir) {
    Expand Unzipper = new Expand();
    Unzipper.setDest(destinationDir);
    Unzipper.setSrc(zipFilepath);
    Unzipper.setTaskType("unzip");
    Unzipper.setTaskName("unzip");
    Unzipper.setProject(new Project());
    Unzipper.setOwningTarget(new Target());
    Unzipper.execute();
}
Also used : Project(org.apache.tools.ant.Project) Target(org.apache.tools.ant.Target) Expand(org.apache.tools.ant.taskdefs.Expand)

Example 22 with Project

use of org.apache.tools.ant.Project in project adempiere by adempiere.

the class CreateZipFile method tarFolder.

public static void tarFolder(File srcFolder, File destTarFile, String includesdir) {
    Tar tarer = new Tar();
    tarer.setDestFile(destTarFile);
    tarer.setBasedir(srcFolder);
    tarer.setIncludes(includesdir);
    tarer.setCaseSensitive(false);
    tarer.setTaskName("tar");
    tarer.setTaskType("tar");
    tarer.setProject(new Project());
    tarer.setOwningTarget(new Target());
    tarer.execute();
}
Also used : Project(org.apache.tools.ant.Project) Target(org.apache.tools.ant.Target) Tar(org.apache.tools.ant.taskdefs.Tar)

Example 23 with Project

use of org.apache.tools.ant.Project in project adempiere by adempiere.

the class CreateZipFile method gzipFile.

public static void gzipFile(File srcFile, File destFile) {
    GZip GZiper = new GZip();
    GZiper.setDestfile(destFile);
    GZiper.setSrc(srcFile);
    GZiper.setTaskName("gzip");
    GZiper.setTaskType("gzip");
    GZiper.setProject(new Project());
    GZiper.setOwningTarget(new Target());
    GZiper.execute();
}
Also used : Project(org.apache.tools.ant.Project) Target(org.apache.tools.ant.Target) GZip(org.apache.tools.ant.taskdefs.GZip)

Example 24 with Project

use of org.apache.tools.ant.Project in project aries by apache.

the class EsaTaskTest method generateArchiveWithNewManifest.

@Test
public void generateArchiveWithNewManifest() {
    File srcDir = new File("../src/test/resources");
    assertTrue(srcDir.exists());
    File destfile = new File("target/esa-test.esa");
    if (destfile.exists()) {
        destfile.delete();
    }
    assertFalse(destfile.exists());
    EsaTask esaTask = new EsaTask();
    Project testProject = new Project();
    esaTask.setProject(testProject);
    FileSet fileSet = new FileSet();
    fileSet.setDir(srcDir);
    fileSet.setIncludes("*.jar");
    esaTask.addFileset(fileSet);
    esaTask.setDestFile(destfile);
    esaTask.setSymbolicName("esatask-test");
    esaTask.setName("ESA Test Task");
    esaTask.setVersion("1.0.0");
    esaTask.setGenerateManifest(true);
    esaTask.execute();
    assertTrue(destfile.exists());
    try {
        ZipFile esaArchive = new ZipFile(destfile);
        assertNotNull(esaArchive);
        ZipEntry subsystemManifest = esaArchive.getEntry("OSGI-INF/SUBSYSTEM.MF");
        assertNotNull(subsystemManifest);
    } catch (IOException e) {
        fail(e.getMessage());
    }
}
Also used : Project(org.apache.tools.ant.Project) FileSet(org.apache.tools.ant.types.FileSet) ZipFile(java.util.zip.ZipFile) ZipEntry(java.util.zip.ZipEntry) IOException(java.io.IOException) ZipFile(java.util.zip.ZipFile) File(java.io.File) Test(org.junit.Test)

Example 25 with Project

use of org.apache.tools.ant.Project in project poi by apache.

the class BuildFileTest method configureProject.

/**
     * Sets up to run the named project
     *
     * @param filename name of project file to run
     */
public void configureProject(String filename, int logLevel) throws BuildException {
    logBuffer = new StringBuffer();
    fullLogBuffer = new StringBuffer();
    project = new Project();
    project.init();
    project.setNewProperty("data.dir.name", getDataDir());
    File antFile = new File(System.getProperty("root"), filename);
    project.setUserProperty("ant.file", antFile.getAbsolutePath());
    project.addBuildListener(new AntTestListener(logLevel));
    ProjectHelper.configureProject(project, antFile);
}
Also used : Project(org.apache.tools.ant.Project) File(java.io.File)

Aggregations

Project (org.apache.tools.ant.Project)80 File (java.io.File)35 BuildException (org.apache.tools.ant.BuildException)23 IOException (java.io.IOException)17 Test (org.junit.Test)13 FileSet (org.apache.tools.ant.types.FileSet)11 ZipFile (java.util.zip.ZipFile)10 IgniteDeploymentGarAntTask (org.apache.ignite.util.antgar.IgniteDeploymentGarAntTask)8 Path (org.apache.tools.ant.types.Path)6 DefaultLogger (org.apache.tools.ant.DefaultLogger)5 ProjectHelper (org.apache.tools.ant.ProjectHelper)5 MissingMethodException (groovy.lang.MissingMethodException)4 DirectoryScanner (org.apache.tools.ant.DirectoryScanner)4 Task (org.apache.tools.ant.Task)4 AbstractProject (hudson.model.AbstractProject)3 Target (org.apache.tools.ant.Target)3 Zip (org.apache.tools.ant.taskdefs.Zip)3 CompilationFailedException (org.codehaus.groovy.control.CompilationFailedException)3 Binding (groovy.lang.Binding)2 GroovyClassLoader (groovy.lang.GroovyClassLoader)2