Class InstallationLayout

java.lang.Object
com.brunoritz.gradle.singularnode.platform.layout.InstallationLayout
Direct Known Subclasses:
UnixInstallationLayout, WindowsInstallationLayout

public abstract class InstallationLayout extends Object
Represents all relevant directories and binaries needed by the plugin. Any access to a file within the tooling installation should be made via this class in order to compensate for different directory layouts on various platforms.
  • Constructor Details

    • InstallationLayout

      protected InstallationLayout(org.gradle.api.file.DirectoryProperty installBaseDir)
  • Method Details

    • nodeJsInstallDir

      public File nodeJsInstallDir()
      Returns the directory within which NodeJS is installed. The directoy is assumed to directly contain the bin, node_modules and compantion directories without an intermediate directory representing the version of the installed tooling.
    • npmInstallDirectory

      public File npmInstallDirectory()
      Returns the directory whiin which the managed version of NPM is installed. The directory returned is the one used to install NPM into using the --prefix switch.
    • yarnInstallDirectory

      public File yarnInstallDirectory()
      Returns the directory whiin which the managed version of Yarn is installed. The directory returned is the one used to install Yarn into using the --prefix switch.
    • pnpmInstallDirectory

      public File pnpmInstallDirectory()
      Returns the directory within which the managed version of PNPM is installed. The directory returned is the one used to install PNPM into using the --prefix switch.
    • nodeJsBinDirectory

      public abstract File nodeJsBinDirectory()
      Returns the directory containing the NodeJS executable. Not that this might not be a subdirectory of the installation directory, but just the installation directory itse.f
    • pathOfNodeExecutable

      public abstract File pathOfNodeExecutable()
      Returns the full path of the executable representing the NodeJS engine.
    • pathOfBundledNpmScript

      public abstract File pathOfBundledNpmScript()
      Returns the full path to the bundled NPM script. Note that this is not the managed version and should only be used for installing the desired version of NPM. The file returned is (depending on the platform) just a symlink to the actual CLI script.
    • pathOfBundnledNpxScript

      public abstract File pathOfBundnledNpxScript()
      Returns the full path to the bundled NPX script. Note that this is not the managed version and should only be used or installing the desired version of NPX.
    • pathOfBundledCliScript

      public abstract File pathOfBundledCliScript(String scriptName)
      Returns the full path of a bundled NPM CLI script. Such files reside within the node_modules directory bundled with the NodeJS installation. The name of the script file itself is <scriptName>-cli.js.
      Parameters:
      scriptName - The script's name without the cli-js suffix
    • pathOfManagedNpmScript

      public abstract File pathOfManagedNpmScript()
      Returns the full path to the NPM installation managed by this plugin. This is the verison of PNPM to be used for all PNPM invocations except for installing the managed version itself.
    • pathOfManagedYarnScript

      public abstract File pathOfManagedYarnScript()
      Returns the full path to the Yarn installation managed by this plugin. This is the verison of Yarn to be used for all Yarn invocations except for installing the managed version itself.
    • pathOfManagedPnpmScript

      public abstract File pathOfManagedPnpmScript()
      Returns the full path to the PNPM installation managed by this plugin. This is the verison of PNPM to be used for all PNPM invocations except for installing the managed version itself.