Skip to content

Conversation

@jbelkins
Copy link
Contributor

@jbelkins jbelkins commented Nov 17, 2025

Description of changes

These changes support moving service clients from being committed to the project to being an opt-in feature to be utilized only during development & distribution.

  • Move generation of the Dependencies.json to aws-sdk-swift since this file is only used by that project
  • Package manifest is now generated for all clients. (Rather than disable its generation, aws-sdk-swift can just not copy it into place)
  • Package manifest generation is moved out of the protocol generator codegen because it is not specific to a protocol.
  • Remove the SwiftSettings fields associated with Package.swift and Dependencies.json since they are no longer needed.

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.

) {
fun writePackageManifest(dependencies: List<SymbolDependency>) {
ctx.delegator.useFileWriter("Package.swift") { writer ->
ctx.writerDelegator().useFileWriter("Package.swift") { writer ->
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The PackageManifestGenerator now uses the non-protocol generation context, since it is not part of any protocol.

val visibility: String,
val internalClient: Boolean,
val generatePackageManifest: Boolean,
val generateDependencyJSON: Boolean,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These two SwiftSettings fields are no longer used since the package manifest is now always generated, and the Dependencies.json file generation has been moved to SDK.

emptyList(),
delegator,
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TestContext now provides a GenerationContext as well as a ProtocolGenerator.GenerationContext (there are too many things named "context" here.)

This allows for testing codegen outside of a specific protocol.

return context
PackageManifestGenerator(testContext.context).writePackageManifest(testContext.generationCtx.delegator.dependencies)
testContext.generationCtx.delegator.flushWriters()
return testContext
Copy link
Contributor Author

@jbelkins jbelkins Nov 17, 2025

Choose a reason for hiding this comment

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

Test setup modified to use the GenerationContext instead of a ProtocolGenerator.GenerationContext to match the changes in PackageManifestGenerator.

See just below for where the context: GenerationContext property is added to TestContext.


LOGGER.info("[${service.id}] Generating unit tests for protocol ${this.protocol}")
val numProtocolUnitTestsGenerated = generateProtocolUnitTests(ctx)
shouldGenerateTestTarget = (numProtocolUnitTestsGenerated > 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • Deleted the unused variable above
  • Moved manifest generation & buffer flush out of the protocol generator
  • Moved "writeAddtionalFiles" to be the very last step in the protocol generator

@jbelkins jbelkins marked this pull request as ready for review November 18, 2025 23:30
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.

1 participant