Package com.sap.cds.maven.plugin.util
Enum Class Platform
- All Implemented Interfaces:
Serializable
,Comparable<Platform>
,Constable
This enum contains all supported platforms.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
Modifier and TypeFieldDescriptionfinal String
Contains the Node.js archive extension.static final Platform
Contains the currentPlatform
.final String
Contains name of node executable, either "node" or "node.exe".final String
Contains the Node.js classifier: "linux-x64", "darwin-x64", "linux-arm64", "darwin-arm64" or "win-x64"final String
Contains name of npm executable, either "npm" or "npm.cmd".final String
Contains name of npx executable, either "npx" or "npx.cmd". -
Method Summary
Modifier and TypeMethodDescriptiongetDownloadPath
(String nodeVersion) Calculates the relative Node.js download path.getNodePath
(String nodeVersion) getNpmPath
(String nodeVersion) getNpxPath
(String nodeVersion) boolean
static Platform
Returns the enum constant of this class with the specified name.static Platform[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LINUX
Running on a Linux operating system -
MAC
Running on Mac OS (Darwin) -
WINDOWS
Running on a Windows operating system
-
-
Field Details
-
CURRENT
Contains the currentPlatform
. -
archiveExtension
Contains the Node.js archive extension. -
node
Contains name of node executable, either "node" or "node.exe". -
nodeClassifier
Contains the Node.js classifier: "linux-x64", "darwin-x64", "linux-arm64", "darwin-arm64" or "win-x64" -
npm
Contains name of npm executable, either "npm" or "npm.cmd". -
npx
Contains name of npx executable, either "npx" or "npx.cmd".
-
-
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
-
getDownloadPath
Calculates the relative Node.js download path.- Parameters:
nodeVersion
- the Node.js version- Returns:
- the calculated relative download path
-
getNodePath
- Parameters:
nodeVersion
- the Node.js version- Returns:
- a relative path to node executable for the current platform
-
getNpmPath
- Parameters:
nodeVersion
- the Node.js version- Returns:
- a relative path to npm executable for the current platform
-
getNpxPath
- Parameters:
nodeVersion
- the Node.js version- Returns:
- a relative path to npx executable for the current platform
-
isWindows
public boolean isWindows()- Returns:
true
if the current platform isWINDOWS
.
-