wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/js/NodeTypeScriptProcessor.java
private Process createProcess(final File sourceFile, final File destFile)
      throws IOException {
    notNull(sourceFile);
    final String[] commandLine = getCommandLine(sourceFile.getPath(), destFile.getPath());
    LOG.debug("CommandLine arguments: {}", Arrays.asList(commandLine));
    final Process process = new ProcessBuilder(commandLine).redirectErrorStream(true).start();

    //Gobblers responsible for reading stream to avoid blocking of the process when the buffer is full.
    final StreamGobbler errorGobbler = new StreamGobbler(process.getErrorStream(), "ERROR");
    // any output?
    final StreamGobbler outputGobbler = new StreamGobbler(process.getInputStream(), "OUTPUT");
    // kick them off
    errorGobbler.start();
    outputGobbler.start();

    return process;
  }
private Process createProcess(final File sourceFile, final File destFile)
      throws IOException {
    notNull(sourceFile);
    final String[] commandLine = getCommandLine(sourceFile.getPath(), destFile.getPath());
    LOG.debug("CommandLine arguments: {}", Arrays.asList(commandLine));
    final Process process = new ProcessBuilder(commandLine).redirectErrorStream(true).start();

    //Gobblers responsible for reading stream to avoid blocking of the process when the buffer is full.
    final StreamGobbler errorGobbler = new StreamGobbler(process.getErrorStream(), "ERROR");
    // any output?
    final StreamGobbler outputGobbler = new StreamGobbler(process.getInputStream(), "OUTPUT");
    // kick them off
    errorGobbler.start();
    outputGobbler.start();

    return process;
  }
private Process createProcess ( final File sourceFile , final File destFile ) throws IOException { notNull ( sourceFile ) ; final String [ ] commandLine = getCommandLine ( sourceFile . getPath ( ) , destFile . getPath ( ) ) ; LOG . debug ( "CommandLine arguments: {}" , Arrays . asList ( commandLine ) ) ; final Process process = new ProcessBuilder ( commandLine ) . redirectErrorStream ( true ) . start ( ) ; //Gobblers responsible for reading stream to avoid blocking of the process when the buffer is full. final StreamGobbler errorGobbler = new StreamGobbler ( process . getErrorStream ( ) , "ERROR" ) ; // any output? final StreamGobbler outputGobbler = new StreamGobbler ( process . getInputStream ( ) , "OUTPUT" ) ; // kick them off errorGobbler . start ( ) ; outputGobbler . start ( ) ; return process ; }
Creates process responsible for running tsc shell command by reading the file content from the sourceFilePath

@param sourceFile
the source path of the file from where the tsc will read the typescript file.
@param destFile
the destination of the compiled file.
@throws IOException
when the process execution fails.
Creates process responsible for running tsc shell command by reading the file content from the sourceFilePath