Package software.amazon.smithy.cli
Enum Class EnvironmentVariable
- All Implemented Interfaces:
Serializable
,Comparable<EnvironmentVariable>
,Constable
Environment variables used by the Smithy CLI.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionIf set to any value, force enables the support of ANSI colors in the output.If set to any value, disable ANSI colors in the output.Configures if and how the Smithy CLI handles dependencies declared in smithy-build.json files.A custom location for the Maven local repository cache.A pipe-delimited list of Maven repositories to use.The current version of the CLI.Used to detect if ANSI colors are supported. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the system property for the variable.get()
Gets the system property or the environment variable for the property, in that order.static String
Gets a system property or environment variable by name, in that order.boolean
isSet()
Returns true if the system property or environment variables is set.void
Sets a system property for the environment variable.static EnvironmentVariable
Returns the enum constant of this class with the specified name.static EnvironmentVariable[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SMITHY_MAVEN_CACHE
A custom location for the Maven local repository cache.Example:
~/.m2/repository
-
SMITHY_MAVEN_REPOS
A pipe-delimited list of Maven repositories to use.Example:
https://example.com/repo1|https://example.com/repo2
-
SMITHY_DEPENDENCY_MODE
Configures if and how the Smithy CLI handles dependencies declared in smithy-build.json files.- ignore: ignore dependencies and assume that they are provided by the caller of the CLI.
- forbid: forbids dependencies from being declared and will fail the CLI if dependencies are declared.
- standard: the assumed default, will automatically resolve dependencies using Apache Maven.
If the CLI detects that Gradle is calling the CLI, dependency resolution is disabled and defaults to
ignore
. You can explicitly enable dependency resolution by settingSMITHY_DEPENDENCY_MODE
tostandard
. -
SMITHY_VERSION
The current version of the CLI. This is set automatically by the CLI. -
NO_COLOR
If set to any value, disable ANSI colors in the output. -
FORCE_COLOR
If set to any value, force enables the support of ANSI colors in the output. -
TERM
Used to detect if ANSI colors are supported.- If set to "dumb" colors are disabled.
- If not set and the operating system is detected as Windows, colors are disabled.
-
-
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
-
getByName
Gets a system property or environment variable by name, in that order.- Parameters:
name
- Variable to get.- Returns:
- Returns the found system property or environment variable or null.
-
isSet
public boolean isSet()Returns true if the system property or environment variables is set.- Returns:
- Returns true if set.
-
get
Gets the system property or the environment variable for the property, in that order.- Returns:
- Returns the found system property or environment variable or null.
-
set
Sets a system property for the environment variable.- Parameters:
value
- Value to set.
-
clear
public void clear()Clears the system property for the variable.
-