Enum Class Architecture

java.lang.Object
java.lang.Enum<Architecture>
dev.dimlight.maven.plugin.shellcheck.Architecture
All Implemented Interfaces:
Serializable, Comparable<Architecture>, Constable

public enum Architecture extends Enum<Architecture>
Light-hearted os/arch detection, just enough to pick up the shellcheck binary. Some arch-dependent logic is also here.
  • Enum Constant Details

    • Linux_x86_64

      public static final Architecture Linux_x86_64
      amd64.
    • Linux_armv6hf

      public static final Architecture Linux_armv6hf
      raspberry pi (arm 32).
    • Linux_aarch64

      public static final Architecture Linux_aarch64
      ARM64.
    • macOS_x86_64

      public static final Architecture macOS_x86_64
      macosx on intel.
    • Windows_x86

      public static final Architecture Windows_x86
      win32.
    • unsupported

      public static final Architecture unsupported
      none of the above.
  • Method Details

    • values

      public static Architecture[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Architecture valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • osArchKey

      public static String osArchKey()
      Returns the currently os/arch key identifier. This identifier is printed as part of the plugin execution and can be used to provide different download urls for different architectures, allowing multi-arch builds.
      Returns:
      the string identifying the architecture for download purposes.
    • detect

      public static Architecture detect()
      Detects the current architecture on which the plugin is being run.
      Returns:
      the detected architecture.
    • embeddedBinPath

      public String embeddedBinPath()
      Returns:
      the path (within our jar) of the shellcheck binary, according to the architecture.
    • isUnixLike

      public boolean isUnixLike()
      Returns:
      true if the system appears to be of the nix family (macosx included).
    • downloadUrl

      public URL downloadUrl()
      Returns:
      the default download url for the detected architecture.
    • makeExecutable

      public void makeExecutable(Path path) throws IOException
      Makes the given path executable (for unices, for windows does nothing).
      Parameters:
      path - the path to make executable.
      Throws:
      IOException - if something goes wrong.
    • idiomaticExecutableSuffix

      public String idiomaticExecutableSuffix()
      Returns:
      the idiomatic suffix for executables dependending on os/arch, i.e. "" for nixes and ".exe" for win.