Class SourcesPlugin
java.lang.Object
software.amazon.smithy.build.plugins.SourcesPlugin
- All Implemented Interfaces:
SmithyBuildPlugin
Copies model sources into the sources plugin.
Model sources are model components that were defined in one of the directories marked as "sources" in the original model or a model component that is found in the updated model but not the original model.
When a JAR is provided as a source, the models contained within the JAR are extracted into the sources directory under a directory with the same name as the JAR without the ".jar" extension; the JAR is not copied into the sources directory. For example, given a JAR at "/foo/baz.jar" that contains a "bar.smithy" file, a source will be created named "baz/bar.smithy".
This plugin can only run if an original model is provided.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(PluginContext context) Executes the plugin, creating any number of artifacts.getName()
Gets the name of the plugin.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.smithy.build.SmithyBuildPlugin
isSerial, requiresValidModel
-
Constructor Details
-
SourcesPlugin
public SourcesPlugin()
-
-
Method Details
-
getName
Description copied from interface:SmithyBuildPlugin
Gets the name of the plugin.- Specified by:
getName
in interfaceSmithyBuildPlugin
- Returns:
- Returns the name (e.g., "MyPlugin").
-
execute
Description copied from interface:SmithyBuildPlugin
Executes the plugin, creating any number of artifacts.- Specified by:
execute
in interfaceSmithyBuildPlugin
- Parameters:
context
- Plugin context for build execution.
-