Skip to content

chore: Build service clients with exact dependencies #953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 5, 2025
Merged

Conversation

jbelkins
Copy link
Contributor

@jbelkins jbelkins commented Aug 5, 2025

Description of changes

Removes the package manifest generator & replaces it with a generator for JSON that describes dependencies.

Scope

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator
import kotlin.jvm.optionals.getOrNull

val SERVICE_CLIENT_JSON_NAME = "Dependencies.json"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type generates a JSON file containing an array with the names of the client's dependencies.

This will be used later when constructing Package.swift.

@@ -40,7 +40,7 @@ class SwiftDependency(
"",
"",
"",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just cleanup below.

@@ -98,6 +98,7 @@ class SwiftSettings(
COPYRIGHT_NOTICE,
VISIBILITY,
FOR_PROTOCOL_TESTS,
INTERNAL_CLIENT,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to add this when I added the internalClient property... it silences a bunch of Kotlin codegen warnings.

import software.amazon.smithy.swift.codegen.TestContext
import software.amazon.smithy.swift.codegen.defaultSettings
import software.amazon.smithy.swift.codegen.protocolgeneratormocks.MockHTTPAWSJson11ProtocolGenerator

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very simple test class for the new service client JSON generator.

@jbelkins jbelkins marked this pull request as ready for review August 5, 2025 14:46
Copy link
Contributor

@sichanyoo sichanyoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming suggestion for better clarity

@@ -0,0 +1,39 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion on naming: something like DependencyJSONGenerator is probably more clearer than ServiceClientJSONGenerator. Relevant to all places where this name is used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed as suggested.

@jbelkins jbelkins merged commit 5275d8e into main Aug 5, 2025
33 checks passed
@jbelkins jbelkins deleted the jbe/deps branch August 5, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants