Search in sources :

Example 11 with BaseOSProcessHandler

use of com.intellij.execution.process.BaseOSProcessHandler in project intellij-elixir by KronicDeth.

the class Builder method run.

private static void run(@NotNull GeneralCommandLine commandLine, @NotNull CompileContext context, @NotNull String builderName, @NotNull CompilerOptions compilerOptions) throws ProjectBuildException {
    Process process;
    try {
        process = commandLine.createProcess();
    } catch (ExecutionException executionException) {
        throw new ProjectBuildException("Failed to run " + builderName, executionException);
    }
    BaseOSProcessHandler handler = new BaseOSProcessHandler(process, commandLine.getCommandLineString(), Charset.defaultCharset());
    com.intellij.execution.process.ProcessAdapter adapter = new ProcessAdapter(context, builderName, commandLine.getWorkDirectory().getPath(), compilerOptions);
    handler.addProcessListener(adapter);
    handler.startNotify();
    handler.waitFor();
}
Also used : ProjectBuildException(org.jetbrains.jps.incremental.ProjectBuildException) ProcessAdapter(org.elixir_lang.jps.builder.ProcessAdapter) ExecutionException(org.elixir_lang.jps.builder.ExecutionException) BaseOSProcessHandler(com.intellij.execution.process.BaseOSProcessHandler)

Aggregations

BaseOSProcessHandler (com.intellij.execution.process.BaseOSProcessHandler)11 ProcessAdapter (com.intellij.execution.process.ProcessAdapter)7 ProcessEvent (com.intellij.execution.process.ProcessEvent)4 Key (com.intellij.openapi.util.Key)4 ProjectBuildException (org.jetbrains.jps.incremental.ProjectBuildException)4 IOException (java.io.IOException)2 NotNull (org.jetbrains.annotations.NotNull)2 Nullable (org.jetbrains.annotations.Nullable)2 ExecutionException (com.intellij.execution.ExecutionException)1 RunContentExecutor (com.intellij.execution.RunContentExecutor)1 GeneralCommandLine (com.intellij.execution.configurations.GeneralCommandLine)1 KillableColoredProcessHandler (com.intellij.execution.process.KillableColoredProcessHandler)1 ProcessHandler (com.intellij.execution.process.ProcessHandler)1 Function (com.intellij.util.Function)1 UrlClassLoader (com.intellij.util.lang.UrlClassLoader)1 THashMap (gnu.trove.THashMap)1 File (java.io.File)1 OutputStream (java.io.OutputStream)1 Charset (java.nio.charset.Charset)1 ArrayList (java.util.ArrayList)1