refactor: require explicit smithy-build.json in contracts, synthesize for server/client#46
Merged
Merged
Conversation
… for server/client Contracts projects (SmithyPublish=true) must now have an explicit smithy-build.json at the project root. This makes IDE tooling (Smithy VS Code / IntelliJ) able to resolve traits from Maven dependencies (alloy, aws-traits, etc.) when editing .smithy files. Server/client projects without a local smithy-build.json get one synthesized in obj/ by reading the contracts smithy-build.json, patching sources to absolute paths, and injecting the csharp-codegen Maven dep and plugin entry via the new SynthesizeSmithyBuildFile MSBuild task. Removes SmithyMavenDependency, SmithyBuildSuppression, SmithyGenerateDocs, SmithyOpenApiProtocol, and SmithyVersion from the public MSBuild surface area. Adds SmithyCSharpCodegenVersion (default: 0.1.0-SNAPSHOT). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…sion Gives users a single documented place to find which Smithy version is bundled, so software.amazon.smithy:* Maven artifacts in contracts smithy-build.json files can be kept in sync. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Restores docgen and openapi plugin injection into the synthesized smithy-build.json, now handled properly in SynthesizeSmithyBuildFile rather than via MSBuild string manipulation. Also restores _CopyOpenApiToWwwroot and _CopyDocgenToWwwroot targets, and restores SmithyGenerateDocs/SmithyOpenApiProtocol usage in the rest-json1 and simple-rest-json server examples. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add smithy-build.json to contracts, standalone server, and IsMaven client templates; configure //#if conditional processing for them - Remove SmithyMavenDependency items from all templates (deps now live in smithy-build.json) - Remove SmithySource items from standalone server template (sources declared in smithy-build.json) - Exclude smithy-build.json from server template when WithContracts, and from client template when not IsMaven - Drop .m2 repository from all smithy-build.json files and from the synthesis default (Smithy CLI already checks it by default) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SmithyPublish=true) now require an explicitsmithy-build.jsonat the project root, so IDE tooling (Smithy VS Code / IntelliJ) can resolve traits from Maven dependencies (alloy, aws-traits, etc.) when editing.smithyfilessmithy-build.jsonget one synthesized inobj/via a newSynthesizeSmithyBuildFileMSBuild task — reads the contractssmithy-build.json, patchessourcesto absolute paths, and injects thecsharp-codegenMaven dep + plugin entrysmithy-build.jsoncontinue to use it as-is (the existing eject path)SmithyMavenDependency,SmithyBuildSuppression,SmithyGenerateDocs,SmithyOpenApiProtocol, andSmithyVersionfrom the public MSBuild surface areaSmithyCSharpCodegenVersionproperty (default:0.1.0-SNAPSHOT) for pinning the injected codegen depTest plan
examples/simple-rest-json— contracts, server, and client should all build and codegen should succeedexamples/rest-json1— same.smithyfile inexamples/simple-rest-json/contractsin VS Code with the Smithy extension — alloy traits (@alloy.protocols#simpleRestJson) should resolve without errorssmithy-build.jsonsynthesizes one inobj/containing the contracts' Maven deps and acsharp-codegenplugin entrysmithy-build.json(andSmithyPublish=true) produces a clear error🤖 Generated with Claude Code