Repository navigation
Make Stunts.CompiledProxy the only reference a generator project needs - #361
Merged
Merged
Conversation
A project that builds a generator on StuntGenerator failed to compile with the package alone: it had no compiler API and no Stunts.CodeAnalysis, whose NamingConvention the generator API takes. The standalone package now carries Stunts.CodeAnalysis.dll next to Stunts.CompiledProxy.dll, and depends on Microsoft.CodeAnalysis.CSharp 5.0 and on Stunts (assembly and analyzers) instead of embedding Stunts.dll. Its build targets set what the compiler analyzers require of a generator project (RS1036, RS1042), and keep the reference out of the package a NuGetizer project ships the generator in. The package readme now shows the resulting project file. It does not depend on the Stunts.CodeAnalysis package, which embeds Stunts.dll and BCL assemblies: consumers of the generator load the Stunts assemblies from the Stunts package. That package is unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: CodeAlta <noreply@codealta.io>
kzu
enabled auto-merge (rebase)
November 29, 2026 05:49
The standalone package had no documentation for StuntGenerator, ISyntaxProcessor or NamingConvention. The default in Directory.Build.targets never applies, since the SDK sets GenerateDocumentationFile to false before it is imported, so both projects now set it, as Stunts and Stunts.Extensions do. The package carries both .xml files next to their assemblies in lib/netstandard2.0. The Stunts package keeps its layout: the documentation stays out of tools/5.0 and analyzers/dotnet. Also fixes the comments the compiler now checks: stale crefs and the diagnostic summaries that sat above the wrong descriptor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: CodeAlta <noreply@codealta.io>
The project reference adds only the assembly to ReferenceCopyLocalPaths, so the standalone package took the .xml from next to it. No .xml reaches the files packed as a tool, so that filter needs no exclusion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: CodeAlta <noreply@codealta.io>
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.
A project that builds a generator on
StuntGeneratornow needs nothing but theStunts.CompiledProxypackage reference. Before, it failed to compile without also referencing the Roslyn API andStunts.CodeAnalysis(forNamingConvention).Package changes
lib/netstandard2.0holdsStunts.CompiledProxy.dllandStunts.CodeAnalysis.dll, no longer a copy ofStunts.dll.Microsoft.CodeAnalysis.CSharp5.0.0, andStuntswithinclude="compile,runtime,analyzers"(its build targets and content stay out of the generator project).EnforceExtendedAnalyzerRulesunless the project sets it (RS1036), suppressRS1042, and mark the referencePack="false"so a NuGetizer-packed generator does not depend on it.Stuntspackage is unchanged.It deliberately does not depend on the
Stunts.CodeAnalysispackage: that package embedsStunts.dlland BCL assemblies inlib/. Consumers of an extender's generator load the Stunts assemblies from their ownStuntspackage, so the standalone package only has to compile the generator and run it in its tests.The package readme and
AGENTS.mddescribe the setup and how to validate it.Verification
Done against freshly packed packages, with scratch projects outside the repo:
netstandard2.0project with only the package reference builds with no warnings and generates its proxies in-process.lib/, generator intools/, depending only onStunts) works in an app that references nothing else: the generator loads from theStuntspackage's assemblies and the mock is created and intercepted.ST022andRS1035are reported in the generator project.There is no automated test for the package shape.
🤖 Generated with Claude Code
This pull request was created by CodeAlta.