Class Runner

java.lang.Object
dev.gmitch215.bytebox.gradle.Runner

public final class Runner extends Object
Finds something that can run a Node command-line tool.

Resolved once, in the order a developer would try by hand: the tool itself if it is already installed, then bunx, then deno, then npx. An installed binary comes first because it is the fastest and because a project that installed one meant to use it.

Since:
1.0.0
  • Field Details

    • WRANGLER

      public static final String WRANGLER
      The Wrangler CLI, which is what most of these tasks run.
      See Also:
    • BINDGEN

      public static final String BINDGEN
      The binding generator, which ships with the bytebox npm package.
      See Also:
  • Method Details

    • resolve

      public static Runner resolve(String override)
      Resolves a runner for the Wrangler CLI.
      Parameters:
      override - a pinned runner name, or null to search
      Returns:
      the runner
    • resolve

      public static Runner resolve(String override, String tool)
      Resolves a runner for a named tool, or explains what to install.
      Parameters:
      override - a pinned runner name, or null to search
      tool - the npm command to run
      Returns:
      the runner
    • executable

      public String executable()
      Returns the resolved executable, so a build can log which one it found.
      Returns:
      the resolved executable, so a build can log which one it found
    • describe

      public String describe()
      Returns a description for the build log.
      Returns:
      a description for the build log
    • command

      public List<String> command(List<String> args)
      The full command line for a Wrangler invocation.
      Parameters:
      args - the Wrangler arguments
      Returns:
      the command