Class SmithyBuildConfig
- All Implemented Interfaces:
software.amazon.smithy.utils.ToSmithyBuilder<SmithyBuildConfig>
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SmithyBuildConfig.Builder
builder()
static SmithyBuildConfig
fromNode
(software.amazon.smithy.model.node.Node node) Gets the paths to all of the models to import.Gets the globally configured plugins that are applied to every projection.Gets all of the configured projections.Gets the version of Smithy-Build.boolean
If a plugin can't be found, Smithy will by default fail the build.static SmithyBuildConfig
Loads a SmithyBuildConfig from a JSON file on disk.
-
Method Details
-
fromNode
-
builder
- Returns:
- Creates a builder used to build a
SmithyBuildConfig
.
-
load
Loads a SmithyBuildConfig from a JSON file on disk.The file is expected to contain the following structure:
{ "version": "1.0", "imports": ["foo.json", "baz.json"], "outputDirectory": "build/output", "projections": { "projection-name": { "transforms": [ {"name": "transform-name", "args": ["argument1", "argument2", "..."]}, {"name": "other-transform"} }, "plugins": { "plugin-name": { "plugin-config": "value" }, "...": {} } } }, "plugins": { "plugin-name": { "plugin-config": "value" }, "...": {} } }
- Parameters:
file
- File to load and parse.- Returns:
- Returns the loaded FileConfig.
- Throws:
RuntimeException
- if the file cannot be loaded.
-
toBuilder
- Specified by:
toBuilder
in interfacesoftware.amazon.smithy.utils.ToSmithyBuilder<SmithyBuildConfig>
-
getVersion
Gets the version of Smithy-Build.- Returns:
- Returns the version.
-
getImports
Gets the paths to all of the models to import.Paths can point to individual model files or directories. All models stored in all recursive directories will be imported.
- Returns:
- Gets the list of models to import.
-
getOutputDirectory
- Returns:
- Gets the optional output directory to store artifacts.
-
getProjections
Gets all of the configured projections.- Returns:
- Gets the available projections as a map of name to config.
-
getPlugins
Gets the globally configured plugins that are applied to every projection.- Returns:
- Gets plugin settings.
-
isIgnoreMissingPlugins
public boolean isIgnoreMissingPlugins()If a plugin can't be found, Smithy will by default fail the build. This setting can be set to true to allow the build to progress even if there is a missing plugin.- Returns:
- Returns true if missing build plugins are allowed.
-