Package org.apache.tools.ant.taskdefs

Examples of org.apache.tools.ant.taskdefs.PumpStreamHandler


   */
  protected int execInOtherVM(String[] args) {
    try {

      Project project = getProject();
      PumpStreamHandler handler = new LogStreamHandler(this, verbose ? Project.MSG_VERBOSE : Project.MSG_INFO,
          Project.MSG_WARN);

      // replace above two lines with what follows as an aid to debugging when running the unit tests....
      // LogStreamHandler handler = new LogStreamHandler(this,
      // Project.MSG_INFO, Project.MSG_WARN) {
View Full Code Here


        log("Javadoc execution", Project.MSG_INFO);

        JavadocOutputStream out = new JavadocOutputStream(Project.MSG_INFO);
        JavadocOutputStream err = new JavadocOutputStream(Project.MSG_WARN);
        Execute exe = new Execute(new PumpStreamHandler(out, err));
        exe.setAntRun(getProject());

        /*
         * No reason to change the working directory as all filenames and
         * path components have been resolved already.
View Full Code Here

            FileOutputStream fos = new FileOutputStream(tmp);
            tmp2 = new File("pvcs_ant_" + rand.nextLong() + ".log");
            log(commandLine.describeCommand(), Project.MSG_VERBOSE);
            try {
                result = runCmd(commandLine,
                                new PumpStreamHandler(fos,
                                    new LogOutputStream(this,
                                                        Project.MSG_WARN)));
            } finally {
                fos.close();
            }
View Full Code Here

            } else if (!quiet) {
                errorstream = new LogOutputStream(this, Project.MSG_WARN);
            } else {
                errorstream = new LogOutputStream(this, Project.MSG_DEBUG);
            }
            streamhandler = new PumpStreamHandler(outputstream, errorstream);
        }

        Execute exe = getExecute(toExecute, streamhandler);
        try {
            log("Building the RPM based on the " + specFile + " file");
View Full Code Here

        return names;
    }

    /** execute in a forked VM */
    private int run(String[] command, OutputStream out, OutputStream err) throws IOException {
        PumpStreamHandler psh;
        if (err == null) {
            psh = new PumpStreamHandler(out, bos);
        } else {
            psh = new PumpStreamHandler(out, new TeeOutputStream(err, bos));
        }

        Execute exe = new Execute(psh, null);

        exe.setAntRun(getProject());
View Full Code Here

                    throw new BuildException(e, location);
                }
            } else {
                errorstream = new LogOutputStream(this, Project.MSG_WARN);
            }
            streamhandler = new PumpStreamHandler(outputstream, errorstream);
        }

        Execute exe = new Execute(streamhandler, null);

        exe.setAntRun(project);
View Full Code Here

            FileOutputStream fos = new FileOutputStream(tmp);
            tmp2 = new File("pvcs_ant_" + rand.nextLong() + ".log");
            log(commandLine.describeCommand(), Project.MSG_VERBOSE);
            try {
                result = runCmd(commandLine,
                                new PumpStreamHandler(fos,
                                    new LogOutputStream(this,
                                                        Project.MSG_WARN)));
            } finally {
                fos.close();
            }
View Full Code Here

        if (args != null) {
            cmdLine.addAll(args);
        }
       
        ExecuteWatchdog watchdog = new ExecuteWatchdog( timeout );
        ExecuteStreamHandler streamHandler = new PumpStreamHandler( out, out, in );
        Execute exec = new Execute( streamHandler, watchdog );
        exec.setCommandline( cmdLine.toArray(new String[] {}) );
        List<String> env = getCommandEnvironment(command);
        if (!env.isEmpty()) {
            exec.setEnvironment(env.toArray(new String[] {}) );
View Full Code Here

                    throw new BuildException(e, getLocation());
                }
            } else {
                errorstream = new LogOutputStream(this, Project.MSG_WARN);
            }
            streamhandler = new PumpStreamHandler(outputstream, errorstream);
        }

        Execute exe = new Execute(streamhandler, null);

        exe.setAntRun(getProject());
View Full Code Here

     * @throws BuildException
     * @see org.apache.tools.ant.taskdefs.Execute#execute
     */
    public void start() throws BuildException {
        if (p4input != null && p4input.length() > 0) {
            myHandler = new PumpStreamHandler(new P4OutputStream(this), new P4OutputStream(this),
                new ByteArrayInputStream(p4input.getBytes()));
        } else {
            myHandler = new PumpStreamHandler(new P4OutputStream(this), new P4OutputStream(this));
        }
        myHandler.setProcessInputStream(os);
        myHandler.setProcessErrorStream(es);
        myHandler.setProcessOutputStream(is);
        myHandler.start();
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.taskdefs.PumpStreamHandler

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.