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();
}
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();
}
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();
}
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());
}
}
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);
}
Aggregations