Class CMakeExecutor

java.lang.Object
io.github.glorrian.cmakegradleplugin.CMakeExecutor

public class CMakeExecutor extends Object
Executor implementation for running CMake commands.
  • Constructor Details

    • CMakeExecutor

      public CMakeExecutor(Class<?> execClass)
      Accepts an argument to define the task for which the command will be executed. The class object is used only for logging
      Parameters:
      execClass - Class label for logger messages
  • Method Details

    • execute

      public void execute(List<String> cmdLine, File workingDir)
      A method for executing a command in a specific build directory.
      Parameters:
      cmdLine - List containing command line arguments. Each argument must be defined in a separate list item. Spaces inside arguments are not allowed
      workingDir - Directory where the commands are executed
    • execute

      public void execute(List<String> cmdLine, File workingDir, Consumer<? super String> inputPrintAction, Consumer<? super String> errorPrintAction)
      A method for executing a command in a specific build directory with custom print functions.
      Parameters:
      cmdLine - List containing command line arguments. Each argument must be defined in a separate list item. Spaces inside arguments are not allowed
      workingDir - Directory where the commands are executed
      inputPrintAction - Function for printing the output of the execution
      errorPrintAction - Function for printing output of execution errors