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 SummaryNested Classes Modifier and Type Class Description static classSmithyBuildConfig.BuilderBuilder used to create aSmithyBuildConfig.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SmithyBuildConfig.Builderbuilder()static SmithyBuildConfigfromNode(Node node)java.util.List<java.lang.String>getImports()Gets the paths to all the models to import.longgetLastModifiedInMillis()Get the last modified time of the configuration file.java.util.Optional<MavenConfig>getMaven()Gets Maven dependency configuration.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 the configured projections.java.util.List<java.lang.String>getSources()Gets the paths to all model sources.java.lang.StringgetVersion()Gets the version of Smithy-Build.booleanisIgnoreMissingPlugins()If a plugin can't be found, Smithy will by default fail the build.static SmithyBuildConfigload(java.nio.file.Path file)Loads a SmithyBuildConfig from a JSON file on disk.SmithyBuildConfig.BuildertoBuilder()Take this object and create a builder that contains all of the current property values of this object.
 
- 
- 
- 
Method Detail- 
fromNodepublic static SmithyBuildConfig fromNode(Node node) 
 - 
builderpublic static SmithyBuildConfig.Builder builder() - Returns:
- Creates a builder used to build a SmithyBuildConfig.
 
 - 
loadpublic 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", "sources": ["model"], "imports": ["foo.json", "baz.json"], "outputDirectory": "build/output", "maven" { "dependencies": ["software.amazon.smithy:smithy-aws-traits:1.26.1"], "repositories": [ { "url": "https://example.com/maven", "httpCredentials": "${MAVEN_USER}:${MAVEN_PASSWORD}" } ] } "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.
 
 - 
toBuilderpublic SmithyBuildConfig.Builder toBuilder() Description copied from interface:ToSmithyBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
- toBuilderin interface- ToSmithyBuilder<SmithyBuildConfig>
- Returns:
- a builder for type T
 
 - 
getVersionpublic java.lang.String getVersion() Gets the version of Smithy-Build.- Returns:
- Returns the version.
 
 - 
getImportspublic java.util.List<java.lang.String> getImports() Gets the paths to all 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.
 
 - 
getSourcespublic java.util.List<java.lang.String> getSources() Gets the paths to all model sources.Paths can point to individual model files or directories. All models stored in all recursive directories will be imported. Each found Smithy model will be considered a source model. - Returns:
- Gets the list of models to import.
 
 - 
getOutputDirectorypublic java.util.Optional<java.lang.String> getOutputDirectory() - Returns:
- Gets the optional output directory to store artifacts.
 
 - 
getProjectionspublic java.util.Map<java.lang.String,ProjectionConfig> getProjections() Gets all the configured projections.- Returns:
- Gets the available projections as a map of name to config.
 
 - 
getPluginspublic java.util.Map<java.lang.String,ObjectNode> getPlugins() Gets the globally configured plugins that are applied to every projection.- Returns:
- Gets plugin settings.
 
 - 
isIgnoreMissingPluginspublic 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.
 
 - 
getMavenpublic java.util.Optional<MavenConfig> getMaven() Gets Maven dependency configuration.Note that smithy-build does not directly resolve or use dependencies. It's up to other packages like the Smithy CLI to use a dependency resolver based on smithy-build.json configuration and call smithy-build with the appropriate classpath. - Returns:
- Returns Maven dependency information.
 
 - 
getLastModifiedInMillispublic long getLastModifiedInMillis() Get the last modified time of the configuration file.- Returns:
- Returns the last modified time in milliseconds since the epoch.
 
 
- 
 
-