Package org.apache.tools.ant.helper

Examples of org.apache.tools.ant.helper.ProjectHelper2


            return helper;
        } else {
            try {
                // Default
                // return new ProjectHelperImpl();
                return new ProjectHelper2();
            } catch (Throwable e) {
                String message = "Unable to load default ProjectHelper due to "
                    + e.getClass().getName() + ": " + e.getMessage();
                throw new BuildException(message, e);
            }
View Full Code Here


        ComponentHelper helper =
            ComponentHelper.getComponentHelper(project);
        helper.enterAntLib(uri);
        try {
            // Should be safe to parse
            ProjectHelper2 parser = new ProjectHelper2();
            UnknownElement ue =
                parser.parseUnknownElement(project, antlibUrl);
            // Check name is "antlib"
            if (!(ue.getTag().equals(TAG))) {
                throw new BuildException(
                    "Unexpected tag " + ue.getTag() + " expecting "
                    + TAG, ue.getLocation());
View Full Code Here

        File build_file = new File(build_file_str);

        try {
            project.setCoreLoader(getClass().getClassLoader());
            project.init();
            new ProjectHelper2().parse(project, build_file);
            project.executeTarget(project.getDefaultTarget());
        } catch (BuildException e) {
            throw new RuntimeException("Cannot run ANT on script [" + build_file_str + "]. Cause: " + e, e);
        }
    }
View Full Code Here

            for (Map.Entry<Object, Object> taskDef : taskDefs.entrySet()) {
                project.addTaskDefinition(taskDef.getKey().toString(),
                    Class.forName(taskDef.getValue().toString(), true, classLoader));
            }

            new ProjectHelper2().parse(project, buildFile);
            project.executeTarget(project.getDefaultTarget());

        } catch (Exception e) {
            throw new RuntimeException("Cannot run ANT on script [" + buildFile + "]. Cause: " + e, e);
        } finally {
View Full Code Here

            for (Map.Entry<Object, Object> taskDef : taskDefs.entrySet()) {
                project.addTaskDefinition(taskDef.getKey().toString(), Class.forName(taskDef.getValue().toString(),
                    true, classLoader));
            }

            new ProjectHelper2().parse(project, buildFile);
            project.executeTarget((target == null) ? project.getDefaultTarget() : target);
        } catch (Exception e) {
            throw new RuntimeException("Cannot run ANT on script [" + buildFile + "]. Cause: " + e, e);
        } finally {
            if (logFileOutput != null) {
View Full Code Here

            for (Map.Entry<Object, Object> taskDef : taskDefs.entrySet()) {
                project.addTaskDefinition(taskDef.getKey().toString(), Class.forName(taskDef.getValue().toString(),
                    true, classLoader));
            }

            new ProjectHelper2().parse(project, buildFile);
            project.executeTarget(project.getDefaultTarget());
        } catch (Exception e) {
            throw new RuntimeException("Cannot run Ant on script [" + buildFile + "] - cause: " + e, e);
        } finally {
            if (logFileOutput != null) {
View Full Code Here

            project.setCoreLoader(getClass().getClassLoader());
            project.init();
            project.setProperty("target.schema.version", targetVersion == null ? "LATEST" : targetVersion);
            loadDbSetupAntTasksProperties(project);

            new ProjectHelper2().parse(project, upgradeFile);

            Target defaultTarget = (Target) project.getTargets().get(project.getDefaultTarget());

            for (Task t : defaultTarget.getTasks()) {
                DBUpgrader upgrader = null;
View Full Code Here

        BundleAntProject project = createProject(buildFile, true, buildProperties);
        if (handoverTarget != null) {
            project.setHandoverTarget(handoverTarget);
        }

        ProjectHelper2 projectHelper = new ProjectHelper2();
        try {
            // Use the 3-param version of parse(), rather than the 2-param version, or ProjectHelper.configureProject(),
            // to avoid actually executing the implicit target (which would cause the rhq:bundle task to be executed).
            AntXMLContext context = (AntXMLContext) project.getReference(REFID_CONTEXT);
            projectHelper.parse(project, buildFile, new ProjectHelper2.RootHandler(context,
                new ProjectHelper2.MainHandler()));
        } catch (BuildException e) {
            throw new InvalidBuildFileException("Failed to parse bundle Ant build file.", e);
        }
View Full Code Here

                e.printStackTrace(System.err);
            }
        }

        // last but not least, ant default project helper
        projectHelper = new ProjectHelper2();
        registerProjectHelper(projectHelper);
    }
View Full Code Here

        ComponentHelper helper =
            ComponentHelper.getComponentHelper(project);
        helper.enterAntLib(uri);
        try {
            // Should be safe to parse
            ProjectHelper2 parser = new ProjectHelper2();
            UnknownElement ue =
                parser.parseUnknownElement(project, antlibUrl);
            // Check name is "antlib"
            if (!(ue.getTag().equals(TAG))) {
                throw new BuildException(
                    "Unexpected tag " + ue.getTag() + " expecting "
                    + TAG, ue.getLocation());
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.helper.ProjectHelper2

Copyright © 2018 www.massapicom. 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.