Package org.bytedeco.javacpp.tools
Class CommandExecutor
- java.lang.Object
-
- org.bytedeco.javacpp.tools.CommandExecutor
-
public class CommandExecutor extends Object
A wrapper for ProcessBuilder that can be overridden easily for frameworks like Gradle that don't support it well.- Author:
- Samuel Audet
-
-
Constructor Summary
Constructors Constructor Description CommandExecutor(Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intexecuteCommand(List<String> command, File workingDirectory, Map<String,String> environmentVariables)Executes a command withProcessBuilder, but also logs the call and redirects its input and output to our process.
-
-
-
Field Detail
-
logger
final Logger logger
-
-
Constructor Detail
-
CommandExecutor
public CommandExecutor(Logger logger)
-
-
Method Detail
-
executeCommand
public int executeCommand(List<String> command, File workingDirectory, Map<String,String> environmentVariables) throws IOException, InterruptedException
Executes a command withProcessBuilder, but also logs the call and redirects its input and output to our process.- Parameters:
command- to haveProcessBuilderexecuteworkingDirectory- to pass toProcessBuilder.directory()environmentVariables- to put inProcessBuilder.environment()- Returns:
- the exit value of the command
- Throws:
IOExceptionInterruptedException
-
-