Enum Class Architecture
- All Implemented Interfaces:
Serializable,Comparable<Architecture>,Constable
Light-hearted os/arch detection, just enough to pick up the shellcheck binary.
Some arch-dependent logic is also here.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionARM64.raspberry pi (arm 32).amd64.macosx on intel.none of the above.win32. -
Method Summary
Modifier and TypeMethodDescriptionstatic Architecturedetect()Detects the current architecture on which the plugin is being run.booleanvoidmakeExecutable(Path path) Makes the given path executable (for unices, for windows does nothing).static StringReturns the currently os/arch key identifier.static ArchitectureReturns the enum constant of this class with the specified name.static Architecture[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
Linux_x86_64
amd64. -
Linux_armv6hf
raspberry pi (arm 32). -
Linux_aarch64
ARM64. -
macOS_x86_64
macosx on intel. -
Windows_x86
win32. -
unsupported
none of the above.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
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
Detects the current architecture on which the plugin is being run.- Returns:
- the detected architecture.
-
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
- Returns:
- the default download url for the detected architecture.
-
makeExecutable
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
- Returns:
- the idiomatic suffix for executables dependending on os/arch, i.e. "" for nixes and ".exe" for win.
-