From 43dd266595b8bc28016cbb69e82ba76ba04fe35e Mon Sep 17 00:00:00 2001 From: Hunter Mellema Date: Thu, 13 Feb 2025 10:56:31 -0700 Subject: [PATCH 1/3] Add smithy-java quickstart guide --- docs/conf.py | 50 ++- docs/source-2.0/index.rst | 6 + docs/source-2.0/java/index.rst | 15 + docs/source-2.0/java/quickstart.rst | 310 ++++++++++++++++++ smithy-uml/README.md | 1 + smithy-uml/build.gradle.kts | 22 ++ .../amazon/smithy/umlgen/SmithyUmlPlugin.java | 35 ++ .../smithy/umlgen/UmlSymbolProvider.java | 4 + ...ware.amazon.smithy.build.SmithyBuildPlugin | 0 9 files changed, 413 insertions(+), 30 deletions(-) create mode 100644 docs/source-2.0/java/index.rst create mode 100644 docs/source-2.0/java/quickstart.rst create mode 100644 smithy-uml/README.md create mode 100644 smithy-uml/build.gradle.kts create mode 100644 smithy-uml/src/main/java/software/amazon/smithy/umlgen/SmithyUmlPlugin.java create mode 100644 smithy-uml/src/main/java/software/amazon/smithy/umlgen/UmlSymbolProvider.java create mode 100644 smithy-uml/src/main/resources/META-INF/services/software.amazon.smithy.build.SmithyBuildPlugin diff --git a/docs/conf.py b/docs/conf.py index 38672fbb9bf..89918c23da6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -67,47 +67,37 @@ def __load_version(): with open('../../VERSION', 'r') as file: return file.read().replace('\n', '') -# We use the __smithy_version__ placeholder in documentation to represent -# the current Smithy library version number. This is found and replaced -# using a source-read pre-processor so that the generated documentation -# always references the current VERSION. -smithy_version = __load_version() -smithy_version_placeholder = "__smithy_version__" - -## Find the latest version of the gradle plugin from github +# Find the latest version of the gradle plugin from github def __load_gradle_version(): return requests.get('https://api.github.com/repos/smithy-lang/smithy-gradle-plugin/tags').json()[0]['name'] -# We use the __smithy_gradle_version__ placeholder in documentation to represent -# the current gradle plugin version number. This is found and replaced -# using a source-read pre-processor so that the generated documentation -# always references the latest release of the gradle plugin -smithy_gradle_plugin_version = __load_gradle_version() -smithy_gradle_version_placeholder = "__smithy_gradle_version__" - -## Find the latest version of the typescript codegen plugin from maven repo +# Find the latest version of the typescript codegen plugin from maven repo def __load_typescript_codegen_version(): return requests.get('https://search.maven.org/solrsearch/select?q=g:"software.amazon.smithy.typescript"' + '+AND+a:"smithy-typescript-codegen"&wt=json').json()['response']['docs'][0]['latestVersion'] -# We use the __smithy_typescript_version__ placeholder in documentation to represent -# the current gradle plugin version number. This is found and replaced +# Find the latest version of smithy-java from github +def __load_java_version(): + return requests.get('https://api.github.com/repos/smithy-lang/smithy-java/tags').json()[0]['name'] + +# We use this list of replacements to replace placeholder values in the documentation +# with computed values. These are found and replaced # using a source-read pre-processor so that the generated documentation -# always references the latest release of the gradle plugin -smithy_typescript_codegen_version = __load_typescript_codegen_version() -smithy_typescript_version_placeholder = "__smithy_typescript_version__" +# always uses the latest computed value for the placeholder. +replacements = [ + ("__smithy_version__", __load_version()), + ("__smithy_gradle_version__", __load_gradle_version()), + ("__smithy_typescript_version__", __load_typescript_codegen_version()), + ("__smithy_java_version__", __load_java_version()) +] def setup(sphinx): sphinx.add_lexer("smithy", SmithyLexer) sphinx.connect('source-read', source_read_handler) - print("Finding and replacing '" + smithy_version_placeholder + "' with '" + smithy_version + "'") - print("Finding and replacing '" + smithy_gradle_version_placeholder + "' with '" + smithy_gradle_plugin_version + "'") - print("Finding and replacing '" + smithy_typescript_version_placeholder + "' with '" + smithy_typescript_codegen_version + "'") - + for placeholder, replacement in replacements: + print("Finding and replacing '" + placeholder + "' with '" + replacement + "'") -# Rewrites __smithy_version__ to the version found in ../VERSION and -# rewrites __smithy_gradle_version__ to the latest version found on Github +# Rewrites placeholders with computed value def source_read_handler(app, docname, source): - source[0] = source[0].replace(smithy_version_placeholder, smithy_version) - source[0] = source[0].replace(smithy_gradle_version_placeholder, smithy_gradle_plugin_version) - source[0] = source[0].replace(smithy_typescript_version_placeholder, smithy_typescript_codegen_version) + for placeholder, replacement in replacements: + source[0] = source[0].replace(placeholder, replacement) diff --git a/docs/source-2.0/index.rst b/docs/source-2.0/index.rst index 6820afeb0d7..e911b521ff4 100644 --- a/docs/source-2.0/index.rst +++ b/docs/source-2.0/index.rst @@ -152,6 +152,12 @@ Read more aws/index ts-ssdk/index +.. toctree:: + :caption: Languages + :maxdepth: 1 + + java/index + .. toctree:: :caption: Project :maxdepth: 1 diff --git a/docs/source-2.0/java/index.rst b/docs/source-2.0/java/index.rst new file mode 100644 index 00000000000..daa88aff8d1 --- /dev/null +++ b/docs/source-2.0/java/index.rst @@ -0,0 +1,15 @@ +==== +Java +==== + +.. toctree:: + :maxdepth: 1 + + quickstart + +.. toctree:: + :caption: References + :maxdepth: 1 + + Source code + Smithy Java Examples diff --git a/docs/source-2.0/java/quickstart.rst b/docs/source-2.0/java/quickstart.rst new file mode 100644 index 00000000000..96cd92fee27 --- /dev/null +++ b/docs/source-2.0/java/quickstart.rst @@ -0,0 +1,310 @@ +=============== +Java Quickstart +=============== + +This guide introduces `Smithy Java `_ with a simple working example of a generated server and client. + +For this example, imagine that you are the proud owner of a coffee shop. +You have a Smithy-modeled API that allows your customers to order some java from their Java apps. +Users can use the generated SDK to list available coffees, order a coffee, and track the status of their order. + +.. admonition:: Review + :class: tip + + If you are new to Smithy or just need a refresher on the basics, you may find it helpful to work through the Smithy :doc:`../quickstart`. + +------------- +Prerequisites +------------- + +* Ensure you have `JDK 17 `_ or higher installed. Older Java versions are not supported by Smithy Java. +* Ensure you have the the Smithy CLI installed. Run ``smithy --version`` to confirm the CLI is correctly installed. If you need to install the CLI, see :doc:`Smithy CLI Installation <../guides/smithy-cli/cli_installation>`. + +------ +Set Up +------ +Clone the quickstart example template using the Smithy CLI ``init`` command and change to the cloned directory: + +.. code-block:: sh + + smithy init -t smithy-java-quickstart && cd smithy-java-quickstart + +The directory tree of the project should look like: + +.. code-block:: sh + + smithy-java-quickstart/ + ├── smithy + │ ├── ... + ├── client + │ ├── ... + ├── server + │ ├── ... + ├── README.md + └── ... + +The example project contains a number of packages: + +* ``smithy/``: Common package for the service API model. Used by both client and server packages. +* ``server/``: Code generated Server that implements stubbed operations code-generated from the service model. +* ``client/``: Code generated client that can call the server. + +From the root of the example project, build the project using Gradle: + +.. code-block:: sh + + ./gradlew clean build + +------------- +Service Model +------------- + +The Smithy API model for our service can be found in the model package. This model defines the interface of our service and guides the generation of client and server code. + +The service provides a few capabilities: + +* Get a menu of available coffees with descriptions +* The ability to order a coffee. +* The ability to check the status of an order. + +The service has the ``@restJson1`` protocol trait applied indicating that the service supports the :ref:`AWS restJson1 protocol `. + +.. code-block:: smithy + :caption: smithy/model/weather.smithy + + /// Allows users to retrieve a menu, create a coffee order, and + /// and to view the status of their orders + @title("Coffee Shop Service") + @restJson1 + service CoffeeShop { + ... + } + +Protocols define the rules and conventions for serializing and de-serializing data when communicating between client and server. +Services can support multiple protocols at once. + +------------------- +Running the project +------------------- + +First, start the coffee shop service by executing the following command: + +.. code-block:: sh + + ./gradlew :server:run + +This will start the coffee shop server on port ``8888`` and log the following to the console: + +.. code-block:: sh + :caption: terminal output + + INFO: Starting server... + INFO: Started listening on http://localhost:8888 + +.. note:: + + Timestamps are omitted from console logs for the sake of brevity. + + +To confirm the service is working, request the menu + +.. code-block:: sh + + curl localhost:8888/menu + +This will return a JSON-formatted menu of coffee types that can be ordered from our cafe: + +.. code-block:: json + + { + "items": [ + { + "type": "DRIP", + "description": "A clean-bodied, rounder, and more simplistic flavour profile.\nOften praised for mellow and less intense notes.\nFar less concentrated than espresso.\n" + }, + { + "type": "POUR_OVER", + "description": "Similar to drip coffee, but with a process that brings out more subtle nuances in flavor.\nMore concentrated than drip, but less than espresso.\n" + }, + { + "type": "LATTE", + "description": "A creamier, milk-based drink made with espresso.\nA subtle coffee taste, with smooth texture.\nHigh milk-to-coffee ratio.\n" + }, + { + "type": "ESPRESSO", + "description": "A highly concentrated form of coffee, brewed under high pressure.\nSyrupy, thick liquid in a small serving size.\nFull bodied and intensely aromatic.\n" + } + ] + } + +.. tip:: + + Use the ``jq``` command line utility to pretty-print the output of the ``curl`` command above. + +You may stop the server with ``CTRL + C``` in the terminal where it is running. +With the server running, we can now call it with our client application. +In a separate terminal, execute the client application: + +.. code-block:: sh + + ./gradlew :client:run + +The client application will use a code-generated Java SDK for the coffee shop service to: + +1. Create a new coffee order for a refreshing COLD_BREW coffee. +2. Wait a few seconds for the order to complete +3. Call the service again to get the order + +The client terminal will print the following to the console (your order ID will differ): + +.. code-block:: sh + :caption: terminal output + + INFO: Created request with id = f526ddca-105c-4f89-a754-a10ea542c84b + INFO: Got order with id = f526ddca-105c-4f89-a754-a10ea542c84b + INFO: Waiting for order to complete.... + INFO: Completed Order :GetOrderOutput[id=f526ddca-105c-4f89-a754-a10ea542c84b, coffee + +---------------------------- +Make a change to the service +---------------------------- + +In this section you will update the Coffee shop server application to support additional functionality. +We would like to add a new operation to our service that allows users to get the hours of our cafe. + +The new operation, ``GetHours`` should be bound directly to our service shape, take no input, and should return an output +with both the opening and closing times. We will host this operation on the route ``/hours`` and the reported hours +will be expressed in whole hours using 24hr time (i.e. 1PM is 13). + +Model Update +============ + +First, the new operation must be added to our service model in the smithy package. + +.. code-block:: diff + :caption: smithy/model/main.smithy + + service CoffeeShop { + version: "2024-08-23" + operations: [ + GetMenu, + + GetHours + ] + resources: [ + Order + ] + } + + + /// Retrieve the coffee shop hours. + + @http(method: "GET", uri: "/hours") + + @readonly + + operation GetHours{ + + output := { + + opensAt: Hour + + closesAt: Hour + + } + + } + + + // Hours for a day expressed in 24hr time + + @range(min: 0, max: 24) + + integer Hour + +Server Update +============= + +With our service model updated, we now need to add the new functionality to our server. First, rebuild the project: + +.. code-block:: sh + + ./gradlew clean build + +This will fail with a compilation error: + +.. code-block:: sh + :caption: ``build`` output + + error: cannot find symbol + ... + .addGetMenuOperation(new GetMenu()) + ^ + symbol: method addGetMenuOperation(GetMenu) + location: interface GetHoursStage + +Smithy Java **requires** that an implementation of a generated operation interface be registered with the server for +every operation defined in service model. Let’s add the required implementation. + +.. code-block:: java + :caption: server/src/main/java/io/smithy/java/server/example/GetHoursOperation.java + + final class GetHours implements GetHoursOperation { + @Override + public GetHoursOutput getHours(GetHoursInput input, RequestContext context) { + return GetHoursOutput.builder() + .opensAt(9) // Opens at 9AM + .closesAt(16) // Closes at 4PM + .build(); + } + } + +And register this operation with our service: + +.. code-block:: diff + :caption: server/src/main/java/io/smithy/java/server/example/CafeService.java + + CoffeeShop.builder() + .addCreateOrderOperation(new CreateOrder()) + + .addGetHoursOperation(new GetHours()) + .addGetMenuOperation(new GetMenu()) + ... + +Now, re-start our server + +.. code-block:: sh + + ./gradlew server:run + +We can now test the new operation using curl: + +.. code-block:: sh + + curl localhost:8888/hours + +Which will return the hours of our Cafe: + +.. code-block:: java + :caption: ``curl`` output + + {"opensAt":9,"closesAt":16} + +Client Update +============= + +What if we want to call our newly created operation from our client application? +The client code generator will automatically add the ``getHours`` operation to the generated client, +we just need to call it in our client application: + +.. code-block:: diff + :caption: client/src/main/java/io/smithy/java/client/example/Main.java + + public static void main(String[] args) throws InterruptedException { + + LOGGER.info(client.getHours(GetHoursInput.builder().build()).toString()); + +Now, with the server still running, call our client one more time: + +.. code-block:: sh + + ./gradlew client:run + +A new log line will now appear, listing the cafe’s hours: + +.. code-block:: sh + :caption: terminal output + + INFO: GetHoursOutput[opensAt=9, closesAt=16] + +---------- +Next steps +---------- + +* Explore other examples: `Smithy Java example projects `_ +* Discover the Smithy ecosystem: `Awesome-Smithy `_ diff --git a/smithy-uml/README.md b/smithy-uml/README.md new file mode 100644 index 00000000000..f597a9badab --- /dev/null +++ b/smithy-uml/README.md @@ -0,0 +1 @@ +TODO: ADD diff --git a/smithy-uml/build.gradle.kts b/smithy-uml/build.gradle.kts new file mode 100644 index 00000000000..2185eb7b0db --- /dev/null +++ b/smithy-uml/build.gradle.kts @@ -0,0 +1,22 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +plugins { + id("smithy.module-conventions") + id("smithy.integ-test-conventions") +} + +description = "This module contains support for generating UML diagrams from Smithy models." + +extra["displayName"] = "Smithy :: UMLGen" +extra["moduleName"] = "software.amazon.smithy.umlgen" + +dependencies { + implementation(project(":smithy-codegen-core")) +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} diff --git a/smithy-uml/src/main/java/software/amazon/smithy/umlgen/SmithyUmlPlugin.java b/smithy-uml/src/main/java/software/amazon/smithy/umlgen/SmithyUmlPlugin.java new file mode 100644 index 00000000000..f3dc7569bf3 --- /dev/null +++ b/smithy-uml/src/main/java/software/amazon/smithy/umlgen/SmithyUmlPlugin.java @@ -0,0 +1,35 @@ +package software.amazon.smithy.umlgen; + +import java.util.logging.Logger; +import software.amazon.smithy.build.PluginContext; +import software.amazon.smithy.build.SmithyBuildPlugin; +import software.amazon.smithy.codegen.core.directed.CodegenDirector; + +public class SmithyUmlPlugin implements SmithyBuildPlugin { + private static final Logger LOGGER = Logger.getLogger(SmithyUmlPlugin.class.getName()); + + private final CodegenDirector + + @Override + public String getName() { + return "smithy-uml"; + } + + @Override + public void execute(PluginContext pluginContext) { + var runner = new CodegenDirector(); + LOGGER.info("Initializing Smithy-UML plugin..."); + var settings = Smithy2PumlSettings.from(pluginContext.getSettings()); + runner.directedCodegen(new Smith2PumlDirectedCodeGen()); + runner.integrationClass(Smithy2PumlIntegration.class); + runner.fileManifest(pluginContext.getFileManifest()); + runner.model(pluginContext.getModel()); + runner.settings(settings); + runner.service(settings.serviceId()); + runner.performDefaultCodegenTransforms(); + runner.createDedicatedInputsAndOutputs(); + LOGGER.info("Executing Smithy2PUML plugin..."); + runner.run(); + LOGGER.info("Smithy2PUML plugin executed successfully."); + } +} diff --git a/smithy-uml/src/main/java/software/amazon/smithy/umlgen/UmlSymbolProvider.java b/smithy-uml/src/main/java/software/amazon/smithy/umlgen/UmlSymbolProvider.java new file mode 100644 index 00000000000..4b4dcdb481b --- /dev/null +++ b/smithy-uml/src/main/java/software/amazon/smithy/umlgen/UmlSymbolProvider.java @@ -0,0 +1,4 @@ +package software.amazon.smithy.umlgen; + +public class UmlSymbolProvider { +} diff --git a/smithy-uml/src/main/resources/META-INF/services/software.amazon.smithy.build.SmithyBuildPlugin b/smithy-uml/src/main/resources/META-INF/services/software.amazon.smithy.build.SmithyBuildPlugin new file mode 100644 index 00000000000..e69de29bb2d From c7f2fab1304eb9419dab4fad7e458680ef1bb923 Mon Sep 17 00:00:00 2001 From: Hunter Mellema <124718352+hpmellema@users.noreply.github.com> Date: Fri, 14 Feb 2025 09:08:42 -0700 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Hayden Baker --- docs/source-2.0/java/quickstart.rst | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/source-2.0/java/quickstart.rst b/docs/source-2.0/java/quickstart.rst index 96cd92fee27..140f0c83823 100644 --- a/docs/source-2.0/java/quickstart.rst +++ b/docs/source-2.0/java/quickstart.rst @@ -5,8 +5,8 @@ Java Quickstart This guide introduces `Smithy Java `_ with a simple working example of a generated server and client. For this example, imagine that you are the proud owner of a coffee shop. -You have a Smithy-modeled API that allows your customers to order some java from their Java apps. -Users can use the generated SDK to list available coffees, order a coffee, and track the status of their order. +Your API allows your customers to order some _java_ from their Java applications. +Users can use your SDK to list available coffees, order a coffee, and track the status of their order. .. admonition:: Review :class: tip @@ -106,7 +106,7 @@ This will start the coffee shop server on port ``8888`` and log the following to Timestamps are omitted from console logs for the sake of brevity. -To confirm the service is working, request the menu +To confirm the service is working, request the menu: .. code-block:: sh @@ -151,9 +151,9 @@ In a separate terminal, execute the client application: The client application will use a code-generated Java SDK for the coffee shop service to: -1. Create a new coffee order for a refreshing COLD_BREW coffee. -2. Wait a few seconds for the order to complete -3. Call the service again to get the order +1. Create a new coffee order for a refreshing COLD_BREW coffee, +2. Wait a few seconds for the order to complete, and +3. Call the service again to get the order. The client terminal will print the following to the console (your order ID will differ): @@ -169,17 +169,17 @@ The client terminal will print the following to the console (your order ID will Make a change to the service ---------------------------- -In this section you will update the Coffee shop server application to support additional functionality. +In this section, you will update the Coffee shop server application to support additional functionality. We would like to add a new operation to our service that allows users to get the hours of our cafe. -The new operation, ``GetHours`` should be bound directly to our service shape, take no input, and should return an output -with both the opening and closing times. We will host this operation on the route ``/hours`` and the reported hours -will be expressed in whole hours using 24hr time (i.e. 1PM is 13). +The new operation, ``GetHours``, should be bound directly to our service shape, take no input, and should return an output +with both the opening and closing times. We will host this operation on the route ``/hours`` , and the reported hours +will be expressed in hours using 24hr time (i.e. 1PM is 13). Model Update ============ -First, the new operation must be added to our service model in the smithy package. +First, the new operation must be added to our service model in the smithy package: .. code-block:: diff :caption: smithy/model/main.smithy @@ -212,7 +212,7 @@ First, the new operation must be added to our service model in the smithy packag Server Update ============= -With our service model updated, we now need to add the new functionality to our server. First, rebuild the project: +With our service model updated, we need to add the new functionality to our server. First, rebuild the project: .. code-block:: sh @@ -231,7 +231,7 @@ This will fail with a compilation error: location: interface GetHoursStage Smithy Java **requires** that an implementation of a generated operation interface be registered with the server for -every operation defined in service model. Let’s add the required implementation. +every operation defined in service model. Let’s add the required implementation: .. code-block:: java :caption: server/src/main/java/io/smithy/java/server/example/GetHoursOperation.java @@ -246,7 +246,7 @@ every operation defined in service model. Let’s add the required implementatio } } -And register this operation with our service: +Next, register this operation with our service: .. code-block:: diff :caption: server/src/main/java/io/smithy/java/server/example/CafeService.java @@ -263,7 +263,7 @@ Now, re-start our server ./gradlew server:run -We can now test the new operation using curl: +Finally, we can test the new operation using curl: .. code-block:: sh @@ -279,7 +279,7 @@ Which will return the hours of our Cafe: Client Update ============= -What if we want to call our newly created operation from our client application? +What if we want to call our new operation from our client application? The client code generator will automatically add the ``getHours`` operation to the generated client, we just need to call it in our client application: @@ -289,7 +289,7 @@ we just need to call it in our client application: public static void main(String[] args) throws InterruptedException { + LOGGER.info(client.getHours(GetHoursInput.builder().build()).toString()); -Now, with the server still running, call our client one more time: +With the server still running, call our client one more time: .. code-block:: sh From b3fc06b19728bdd35f429f38edb3e88d24771294 Mon Sep 17 00:00:00 2001 From: Hunter Mellema Date: Fri, 14 Feb 2025 09:10:57 -0700 Subject: [PATCH 3/3] Remove erroneously added uml package --- smithy-uml/README.md | 1 - smithy-uml/build.gradle.kts | 22 ------------ .../amazon/smithy/umlgen/SmithyUmlPlugin.java | 35 ------------------- .../smithy/umlgen/UmlSymbolProvider.java | 4 --- ...ware.amazon.smithy.build.SmithyBuildPlugin | 0 5 files changed, 62 deletions(-) delete mode 100644 smithy-uml/README.md delete mode 100644 smithy-uml/build.gradle.kts delete mode 100644 smithy-uml/src/main/java/software/amazon/smithy/umlgen/SmithyUmlPlugin.java delete mode 100644 smithy-uml/src/main/java/software/amazon/smithy/umlgen/UmlSymbolProvider.java delete mode 100644 smithy-uml/src/main/resources/META-INF/services/software.amazon.smithy.build.SmithyBuildPlugin diff --git a/smithy-uml/README.md b/smithy-uml/README.md deleted file mode 100644 index f597a9badab..00000000000 --- a/smithy-uml/README.md +++ /dev/null @@ -1 +0,0 @@ -TODO: ADD diff --git a/smithy-uml/build.gradle.kts b/smithy-uml/build.gradle.kts deleted file mode 100644 index 2185eb7b0db..00000000000 --- a/smithy-uml/build.gradle.kts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ -plugins { - id("smithy.module-conventions") - id("smithy.integ-test-conventions") -} - -description = "This module contains support for generating UML diagrams from Smithy models." - -extra["displayName"] = "Smithy :: UMLGen" -extra["moduleName"] = "software.amazon.smithy.umlgen" - -dependencies { - implementation(project(":smithy-codegen-core")) -} - -java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 -} diff --git a/smithy-uml/src/main/java/software/amazon/smithy/umlgen/SmithyUmlPlugin.java b/smithy-uml/src/main/java/software/amazon/smithy/umlgen/SmithyUmlPlugin.java deleted file mode 100644 index f3dc7569bf3..00000000000 --- a/smithy-uml/src/main/java/software/amazon/smithy/umlgen/SmithyUmlPlugin.java +++ /dev/null @@ -1,35 +0,0 @@ -package software.amazon.smithy.umlgen; - -import java.util.logging.Logger; -import software.amazon.smithy.build.PluginContext; -import software.amazon.smithy.build.SmithyBuildPlugin; -import software.amazon.smithy.codegen.core.directed.CodegenDirector; - -public class SmithyUmlPlugin implements SmithyBuildPlugin { - private static final Logger LOGGER = Logger.getLogger(SmithyUmlPlugin.class.getName()); - - private final CodegenDirector - - @Override - public String getName() { - return "smithy-uml"; - } - - @Override - public void execute(PluginContext pluginContext) { - var runner = new CodegenDirector(); - LOGGER.info("Initializing Smithy-UML plugin..."); - var settings = Smithy2PumlSettings.from(pluginContext.getSettings()); - runner.directedCodegen(new Smith2PumlDirectedCodeGen()); - runner.integrationClass(Smithy2PumlIntegration.class); - runner.fileManifest(pluginContext.getFileManifest()); - runner.model(pluginContext.getModel()); - runner.settings(settings); - runner.service(settings.serviceId()); - runner.performDefaultCodegenTransforms(); - runner.createDedicatedInputsAndOutputs(); - LOGGER.info("Executing Smithy2PUML plugin..."); - runner.run(); - LOGGER.info("Smithy2PUML plugin executed successfully."); - } -} diff --git a/smithy-uml/src/main/java/software/amazon/smithy/umlgen/UmlSymbolProvider.java b/smithy-uml/src/main/java/software/amazon/smithy/umlgen/UmlSymbolProvider.java deleted file mode 100644 index 4b4dcdb481b..00000000000 --- a/smithy-uml/src/main/java/software/amazon/smithy/umlgen/UmlSymbolProvider.java +++ /dev/null @@ -1,4 +0,0 @@ -package software.amazon.smithy.umlgen; - -public class UmlSymbolProvider { -} diff --git a/smithy-uml/src/main/resources/META-INF/services/software.amazon.smithy.build.SmithyBuildPlugin b/smithy-uml/src/main/resources/META-INF/services/software.amazon.smithy.build.SmithyBuildPlugin deleted file mode 100644 index e69de29bb2d..00000000000