Search in sources :

Example 1 with AntLoggingAdapter

use of org.gradle.api.internal.project.ant.AntLoggingAdapter in project gradle by gradle.

the class DefaultAntBuilderFactory method create.

public DefaultAntBuilder create() {
    AntLoggingAdapter loggingAdapter = loggingAdapterFactory.create();
    DefaultAntBuilder antBuilder = new DefaultAntBuilder(project, loggingAdapter);
    antBuilder.getProject().setBaseDir(project.getProjectDir());
    antBuilder.getProject().removeBuildListener(antBuilder.getProject().getBuildListeners().get(0));
    antBuilder.getProject().addBuildListener(loggingAdapter);
    stoppable.add(antBuilder);
    return antBuilder;
}
Also used : AntLoggingAdapter(org.gradle.api.internal.project.ant.AntLoggingAdapter)

Example 2 with AntLoggingAdapter

use of org.gradle.api.internal.project.ant.AntLoggingAdapter 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

AntLoggingAdapter (org.gradle.api.internal.project.ant.AntLoggingAdapter)2 Project (org.apache.tools.ant.Project)1 ProjectHelper (org.apache.tools.ant.ProjectHelper)1