com.vaadin.hilla.engine.commandrunner.

Class GradleRunner

java.lang.Object
com.vaadin.hilla.engine.commandrunner.GradleRunner

All Implemented Interfaces:

CommandRunner

public class GradleRunner extends Object implements CommandRunner

Runs a Gradle command.

  • Constructor Details

    • GradleRunner

      public GradleRunner(File projectDir, String... args)

      Creates a Gradle runner.

      Parameters:

      projectDir - the project directory

      args -

  • Method Details

    • forProject

      public static Optional<CommandRunner> forProject(File projectDir, String... args)

      Creates a Gradle runner for the given project directory.

      Parameters:

      projectDir - the project directory

      Returns:

      a Gradle runner if the project directory contains a Gradle project, an empty optional otherwise

    • arguments

      public String[] arguments()

      Description copied from interface: CommandRunner

      Get the arguments to use when running the command.

      Specified by:

      arguments in interface CommandRunner

      Returns:

      the arguments to use when running the command

    • testArguments

      public String[] testArguments()

      Description copied from interface: CommandRunner

      Get the arguments to use when testing if the command is available.

      Specified by:

      testArguments in interface CommandRunner

      Returns:

      the arguments to use when testing if the command is available

    • getLogger

      public org.slf4j.Logger getLogger()

      Description copied from interface: CommandRunner

      Get the logger to use.

      Specified by:

      getLogger in interface CommandRunner

      Returns:

      the logger to use

    • currentDirectory

      public File currentDirectory()

      Description copied from interface: CommandRunner

      Get the directory to run the command in.

      Specified by:

      currentDirectory in interface CommandRunner

      Returns:

      the directory to run the command in

    • executables

      public List<String> executables()

      Description copied from interface: CommandRunner

      Get the executables to try, in order of preference.

      Specified by:

      executables in interface CommandRunner

      Returns:

      the executables to try