Java Code Examples for org.gradle.process.internal.ExecHandle#start()
The following examples show how to use
org.gradle.process.internal.ExecHandle#start() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommandLineJavaCompiler.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
private void executeCompiler(ExecHandle handle) { handle.start(); ExecResult result = handle.waitForFinish(); if (result.getExitValue() != 0) { throw new CompilationFailedException(result.getExitValue()); } }
Example 2
Source File: CommandLineJavaCompiler.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
private void executeCompiler(ExecHandle handle) { handle.start(); ExecResult result = handle.waitForFinish(); if (result.getExitValue() != 0) { throw new CompilationFailedException(result.getExitValue()); } }
Example 3
Source File: AspectJCompiler.java From gradle-plugins with MIT License | 5 votes |
private void executeCompiler(ExecHandle handle) { handle.start(); ExecResult result = handle.waitForFinish(); if (result.getExitValue() != 0) { throw new CompilationFailedException(result.getExitValue()); } }
Example 4
Source File: AspectJCompiler.java From gradle-plugins with MIT License | 5 votes |
private void executeCompiler(ExecHandle handle) { handle.start(); ExecResult result = handle.waitForFinish(); if (result.getExitValue() != 0) { throw new CompilationFailedException(result.getExitValue()); } }
Example 5
Source File: CommandLineJavaCompiler.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
private void executeCompiler(ExecHandle handle) { handle.start(); ExecResult result = handle.waitForFinish(); if (result.getExitValue() != 0) { throw new CompilationFailedException(result.getExitValue()); } }
Example 6
Source File: CommandLineJavaCompiler.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
private void executeCompiler(ExecHandle handle) { handle.start(); ExecResult result = handle.waitForFinish(); if (result.getExitValue() != 0) { throw new CompilationFailedException(result.getExitValue()); } }
Example 7
Source File: ProcessLauncherServer.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 4 votes |
/** * This launches an external process in a thread and waits for it to exit. */ private void launchExternalProcess() { Thread thread = new Thread(new Runnable() { public void run() { ExecutionInfo executionInfo = null; ExecHandle execHandle = null; ByteArrayOutputStream output = null; try { executionInfo = protocol.getExecutionInfo(getPort()); ExecHandleBuilder builder = new ExecHandleBuilder(); builder.workingDir(executionInfo.getWorkingDirectory()); builder.commandLine((Object[]) executionInfo.getCommandLineArguments()); builder.environment(executionInfo.getEnvironmentVariables()); output = new ByteArrayOutputStream(); builder.setStandardOutput(output); builder.setErrorOutput(output); execHandle = builder.build(); setExternalProcess(execHandle); execHandle.start(); } catch (Throwable e) { LOGGER.error("Starting external process", e); notifyClientExited(-1, e.getMessage()); setExternalProcess(null); return; } ExecResult result = execHandle.waitForFinish(); LOGGER.debug("External process completed with exit code {}", result.getExitValue()); setExternalProcess(null); //clear our external process member variable (we're using our local variable below). This is so we know the process has already stopped. executionInfo.processExecutionComplete(); notifyClientExited(result.getExitValue(), output.toString()); } }); thread.start(); }
Example 8
Source File: ProcessLauncherServer.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 4 votes |
/** * This launches an external process in a thread and waits for it to exit. */ private void launchExternalProcess() { Thread thread = new Thread(new Runnable() { public void run() { ExecutionInfo executionInfo = null; ExecHandle execHandle = null; ByteArrayOutputStream output = null; try { executionInfo = protocol.getExecutionInfo(getPort()); ExecHandleBuilder builder = new ExecHandleBuilder(); builder.workingDir(executionInfo.getWorkingDirectory()); builder.commandLine((Object[]) executionInfo.getCommandLineArguments()); builder.environment(executionInfo.getEnvironmentVariables()); output = new ByteArrayOutputStream(); builder.setStandardOutput(output); builder.setErrorOutput(output); execHandle = builder.build(); setExternalProcess(execHandle); execHandle.start(); } catch (Throwable e) { LOGGER.error("Starting external process", e); notifyClientExited(-1, e.getMessage()); setExternalProcess(null); return; } ExecResult result = execHandle.waitForFinish(); LOGGER.debug("External process completed with exit code {}", result.getExitValue()); setExternalProcess(null); //clear our external process member variable (we're using our local variable below). This is so we know the process has already stopped. executionInfo.processExecutionComplete(); notifyClientExited(result.getExitValue(), output.toString()); } }); thread.start(); }