Package org.apache.tools.ant

Examples of org.apache.tools.ant.Project.executeTarget()


                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.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) {
                logFileOutput.close();
View Full Code Here

                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) {
                logFileOutput.close();
View Full Code Here

                    upgrader.setConnection(connection);
                    break;
                }
            }

            project.executeTarget(project.getDefaultTarget());
        } catch (BuildException e) {
            throw new RuntimeException("Cannot run ANT on script [" + upgradeFile + "]. Cause: " + e, e);
        } finally {
            upgradeFile.delete();
        }
View Full Code Here

        ProjectHelper helper = new ProjectHelperImpl();
        File buildPath = new File(baseDir, "build.xml");               
        helper.parse(antProject, buildPath);
                               
        try {
            antProject.executeTarget(platform);           
        } catch(Exception e) {
            if(antProject.getProperty("redirector.err") != null) {
                logger.error("packager-externals-tools-error", antProject.getProperty("redirector.err"));                                   
            }
            throw new BuildException(e.getMessage());
View Full Code Here

        //output the classes into the output dir as well
        javaCompiler.setDestdir(outputLocationFile);
        javaCompiler.setVerbose(true);
        try {
            codeGenProject.executeTarget(COMPILE_TARGET_NAME);
        } catch (BuildException e) {
            fail();
        }

    }
View Full Code Here

            PrintStream err = System.err;
            System.setOut(new PrintStream(new DemuxOutputStream(p, false)));
            System.setErr(new PrintStream(new DemuxOutputStream(p, true)));

            try {
                p.executeTarget("testDemux");
            } finally {
                System.setOut(out);
                System.setErr(err);
            }
        }
View Full Code Here

    @Before
    public void setUp() {
        buildRule.configureProject("src/etc/testcases/taskdefs/optional/net/ftp.xml");
        Project project = buildRule.getProject();
        project.executeTarget("setup");
        tmpDir = project.getProperty("tmp.dir");
        ftp = new FTPClient();
        ftpFileSep = project.getProperty("ftp.filesep");
        myFTPTask.setSeparator(ftpFileSep);
        myFTPTask.setProject(project);
View Full Code Here

            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);
            }
            p.fireBuildFinished(null);
        } catch (BuildException e) {
View Full Code Here

            p.addReference("ant.projectHelper", helper);
            helper.parse(p, buildFile);
            if (target == null || "".equals(target)) {
                p.executeTarget(p.getDefaultTarget());
            } else {
                p.executeTarget(target);
            }
            p.fireBuildFinished(null);
        } catch (BuildException e) {
            p.fireBuildFinished(e);
            throw new AntBuildException(e);
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.