Examples of ProjectHelper


Examples of org.apache.tools.ant.ProjectHelper

        }

        if (onMissingExtensionPoint == null) {
            onMissingExtensionPoint = OnMissingExtensionPoint.FAIL;
        }
        ProjectHelper helper = (ProjectHelper) getProject().getReference(
                ProjectHelper.PROJECTHELPER_REFERENCE);

        for (Iterator<String> itTarget = targets.iterator(); itTarget.hasNext();) {
            helper.getExtensionStack().add(
                    new String[] { extensionPoint, itTarget.next(),
                                            onMissingExtensionPoint.name() });
        }

    }
View Full Code Here

Examples of org.apache.tools.ant.ProjectHelper

        }

        try {
            p.fireBuildStarted();
            p.init();
            ProjectHelper helper = ProjectHelper.getProjectHelper();
            p.addReference("ant.projectHelper", helper);
            helper.parse(p, buildFile);
            if (target == null || "".equals(target)) {
                p.executeTarget(p.getDefaultTarget());
            } else {
                p.executeTarget(target);
            }
View Full Code Here

Examples of org.apache.tools.ant.ProjectHelper

        if (getOwningTarget() == null
            || !"".equals(getOwningTarget().getName())) {
            throw new BuildException("import only allowed as a top-level task");
        }

        ProjectHelper helper =
                (ProjectHelper) getProject().
                    getReference(ProjectHelper.PROJECTHELPER_REFERENCE);

        if (helper == null) {
            // this happens if the projecthelper was not registered with the project.
            throw new BuildException("import requires support in ProjectHelper");
        }

        Vector<Object> importStack = helper.getImportStack();

        if (importStack.size() == 0) {
            // this happens if ant is used with a project
            // helper that doesn't set the import.
            throw new BuildException("import requires support in ProjectHelper");
View Full Code Here

Examples of org.apache.tools.ant.ProjectHelper

                prefix = oldPrefix;
            }
            setProjectHelperProps(prefix, prefixSeparator,
                                  isInIncludeMode());

            ProjectHelper subHelper = ProjectHelperRepository.getInstance().getProjectHelperForBuildFile(
                    importedResource);

            // push current stacks into the sub helper
            subHelper.getImportStack().addAll(helper.getImportStack());
            subHelper.getExtensionStack().addAll(helper.getExtensionStack());
            getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE, subHelper);

            subHelper.parse(getProject(), importedResource);

            // push back the stack from the sub helper to the main one
            getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE, helper);
            helper.getImportStack().clear();
            helper.getImportStack().addAll(subHelper.getImportStack());
            helper.getExtensionStack().clear();
            helper.getExtensionStack().addAll(subHelper.getExtensionStack());
        } catch (BuildException ex) {
            throw ProjectHelper.addLocationToBuildException(
                ex, getLocation());
        } finally {
            setProjectHelperProps(oldPrefix, oldSep, oldIncludeMode);
View Full Code Here

Examples of org.apache.tools.ant.ProjectHelper

            myConsumer.startDocument();
            Project theProject = new Project();
            theProject.addBuildListener(this);
            theProject.fireBuildStarted();
            theProject.init();
            ProjectHelper helper = ProjectHelper.getProjectHelper();
            helper.parse(theProject, myBuildFile);
            if (target.equals("")) {
                target = theProject.getDefaultTarget();
            }
            if (getLogger().isDebugEnabled()) {
                getLogger().debug("executing target "+target+" with log priority level "+myPriorityLevel);
View Full Code Here

Examples of org.apache.tools.ant.ProjectHelper

        this.project = new Project();
        this.project.addBuildListener(this);
        this.project.init();
        File buildFile = getBuildFile(this.buildFile);
        this.project.setUserProperty("ant.file", buildFile.getAbsolutePath());
        ProjectHelper helper = ProjectHelper.getProjectHelper();
        helper.parse(this.project, buildFile);
        if (getProject().getTargets().get("setUp") != null)
        {
            getProject().executeTarget("setUp");
        }
    }
View Full Code Here

Examples of org.apache.tools.ant.ProjectHelper

     */
    public void runAnt(final File buildFile) throws Exception {
        final Project project = new Project();
        project.setCoreLoader(this.getClass().getClassLoader());
        project.init();
        ProjectHelper helper = ProjectHelper.getProjectHelper();
        project.addReference("ant.projectHelper", helper);
        helper.parse(project, buildFile);
        Vector < String > targets = new Vector < String >();
        targets.addElement(project.getDefaultTarget());
        project.setBaseDir(new File("."));
        project.executeTargets(targets);
    }
View Full Code Here

Examples of org.apache.tools.ant.ProjectHelper

        if (getOwningTarget() == null
            || !"".equals(getOwningTarget().getName())) {
            throw new BuildException("import only allowed as a top-level task");
        }

        ProjectHelper helper =
                (ProjectHelper) getProject().
                    getReference(ProjectHelper.PROJECTHELPER_REFERENCE);

        if (helper == null) {
            // this happens if the projecthelper was not registered with the project.
            throw new BuildException("import requires support in ProjectHelper");
        }

        Vector importStack = helper.getImportStack();

        if (importStack.size() == 0) {
            // this happens if ant is used with a project
            // helper that doesn't set the import.
            throw new BuildException("import requires support in ProjectHelper");
View Full Code Here

Examples of org.apache.tools.ant.ProjectHelper

        this.project = new Project();
        this.project.addBuildListener(this);
        this.project.init();
        File buildFile = getBuildFile(this.buildFile);
        this.project.setUserProperty("ant.file", buildFile.getAbsolutePath());
        ProjectHelper helper = ProjectHelper.getProjectHelper();
        helper.parse(this.project, buildFile);
        if (getProject().getTargets().get("setUp") != null)
        {
            getProject().executeTarget("setUp");
        }
    }
View Full Code Here

Examples of org.apache.tools.ant.ProjectHelper

            project.fireBuildStarted();

            project.init();
            project.setBaseDir(publicationDirectory);

            ProjectHelper helper = ProjectHelper.getProjectHelper();
            helper.parse(project, buildFile);

            project.setUserProperty(PUBLICATION_DIRECTORY, publicationDirectory.getAbsolutePath());
            project.setUserProperty(PUBLICATION_ID, publicationId);
            project.setUserProperty(SERVLET_CONTEXT_PATH, servletContextPath);
            project.setUserProperty(CONTEXT_PREFIX, contextPrefix);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.