Class SourcesPlugin

  • All Implemented Interfaces:
    SmithyBuildPlugin

    public final class SourcesPlugin
    extends java.lang.Object
    implements 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 Detail

      • SourcesPlugin

        public SourcesPlugin()
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: SmithyBuildPlugin
        Gets the name of the plugin.
        Specified by:
        getName in interface SmithyBuildPlugin
        Returns:
        Returns the name (e.g., "MyPlugin").
      • execute

        public void execute​(PluginContext context)
        Description copied from interface: SmithyBuildPlugin
        Executes the plugin, creating any number of artifacts.
        Specified by:
        execute in interface SmithyBuildPlugin
        Parameters:
        context - Plugin context for build execution.