Class SmithyBuildConfig
- java.lang.Object
-
- software.amazon.smithy.build.model.SmithyBuildConfig
-
- All Implemented Interfaces:
ToSmithyBuilder<SmithyBuildConfig>
public final class SmithyBuildConfig extends java.lang.Object implements ToSmithyBuilder<SmithyBuildConfig>
Filter configuration that contains a list of named projections that are used to apply filters to a model.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SmithyBuildConfig.Builder
Builder used to create aSmithyBuildConfig
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SmithyBuildConfig.Builder
builder()
java.util.List<java.lang.String>
getImports()
Gets the paths to all of the models to import.java.util.Optional<java.lang.String>
getOutputDirectory()
java.util.Map<java.lang.String,ObjectNode>
getPlugins()
Gets the globally configured plugins that are applied to every projection.java.util.Map<java.lang.String,ProjectionConfig>
getProjections()
Gets all of the configured projections.java.lang.String
getVersion()
Gets the version of Smithy-Build.static SmithyBuildConfig
load(java.nio.file.Path file)
Loads a SmithyBuildConfig from a JSON file on disk.SmithyBuildConfig.Builder
toBuilder()
Take this object and create a builder that contains all of the current property values of this object.
-
-
-
Method Detail
-
builder
public static SmithyBuildConfig.Builder builder()
- Returns:
- Creates a builder used to build a
SmithyBuildConfig
.
-
load
public static SmithyBuildConfig load(java.nio.file.Path file)
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:
java.lang.RuntimeException
- if the file cannot be loaded.
-
toBuilder
public SmithyBuildConfig.Builder toBuilder()
Description copied from interface:ToSmithyBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToSmithyBuilder<SmithyBuildConfig>
- Returns:
- a builder for type T
-
getVersion
public java.lang.String getVersion()
Gets the version of Smithy-Build.- Returns:
- Returns the version.
-
getImports
public java.util.List<java.lang.String> 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
public java.util.Optional<java.lang.String> getOutputDirectory()
- Returns:
- Gets the optional output directory to store artifacts.
-
getProjections
public java.util.Map<java.lang.String,ProjectionConfig> getProjections()
Gets all of the configured projections.- Returns:
- Gets the available projections as a map of name to config.
-
getPlugins
public java.util.Map<java.lang.String,ObjectNode> getPlugins()
Gets the globally configured plugins that are applied to every projection.- Returns:
- Gets plugin settings.
-
-