Search in sources :

Example 6 with ProjectHelper

use of org.apache.tools.ant.ProjectHelper in project gradle by gradle.

the class AntUtil method createProject.

/**
 * @return Factory method to create new Project instances
 */
public static Project createProject() {
    final Project project = new Project();
    final ProjectHelper helper = ProjectHelper.getProjectHelper();
    project.addReference(ProjectHelper.PROJECTHELPER_REFERENCE, helper);
    // import checks that stack is not empty
    helper.getImportStack().addElement("AntBuilder");
    project.addBuildListener(new AntLoggingAdapter());
    project.init();
    project.getBaseDir();
    return project;
}
Also used : Project(org.apache.tools.ant.Project) ProjectHelper(org.apache.tools.ant.ProjectHelper) AntLoggingAdapter(org.gradle.api.internal.project.ant.AntLoggingAdapter)

Aggregations

Project (org.apache.tools.ant.Project)6 ProjectHelper (org.apache.tools.ant.ProjectHelper)6 File (java.io.File)3 BuildException (org.apache.tools.ant.BuildException)1 DefaultLogger (org.apache.tools.ant.DefaultLogger)1 AntLoggingAdapter (org.gradle.api.internal.project.ant.AntLoggingAdapter)1 Test (org.junit.Test)1