Repository navigation
fix: make Facet_SplitGeneratedFiles visible to the generator - #439
Open
kevin-mcmanus wants to merge 1 commit into
Open
kevin-mcmanus wants to merge 1 commit into
kevin-mcmanus wants to merge 1 commit into
Conversation
The property was never listed as a CompilerVisibleProperty, so it never
reached the generator as a build_property and setting it in a .csproj or
Directory.Build.props did nothing -- which is the only way it is
documented, in docs/12_GeneratedFilesOutput.md and the changelog.
Nor was there a workaround. The generator reads build_property.* from
AnalyzerConfigOptions.GlobalOptions, which only MSBuild's generated
global config populates; a hand-written .editorconfig section sets
per-syntax-tree options, which this path never reads.
Before this, a project asking for single-file output still got
{Type}.Properties.g.cs and {Type}.Mappings.g.cs, with no diagnostic.
No test accompanies this: the defect is in MSBuild plumbing, and whether
Facet.props is imported and its properties surfaced is not observable
from inside the test assembly. SplitOutputTests already covers the
generator honouring the option once it arrives.
Co-Authored-By: Claude Opus 5 (1M context) <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.
Facet_SplitGeneratedFileswas never listed as aCompilerVisibleProperty, so it never reached the generator as abuild_property. Setting it in a.csprojorDirectory.Build.propsdid nothing — which is the only way it is documented.docs/12_GeneratedFilesOutput.md:93shows it as aPropertyGroupentry; the changelog says to set it "in your.csprojorDirectory.Build.props". A project asking for single-file output silently kept getting the split files, with no diagnostic.Nor was there a workaround: the generator reads
build_property.*fromAnalyzerConfigOptions.GlobalOptions, which only MSBuild's generated global config populates.The fix
One line in
src/Facet/Facet.props, alongside the sixteen properties already declared there:MSBuild then writes
build_property.Facet_SplitGeneratedFilesinto the generated global config, andGlobalConfigurationDefaults.FromOptionspicks it up through the same path as every otherFacet_*property. No generator change: the option was already honoured once it arrived. The second file in the diff is aCHANGELOG.mdnote.Built the same consumer project against the package from
masterand from this branch. The project sets<Facet_SplitGeneratedFiles>false</Facet_SplitGeneratedFiles>in both runs, so only the package differs:The property is
trueby default, so split output is the normal behaviour andfalseis the opt-out to the pre-6.x single-file layout. The defect was that a project asking for that opt-out silently kept getting the split files.No test: the defect is in MSBuild plumbing, and whether
Facet.propsis imported and its properties surfaced isn't observable from inside the test assembly.SplitOutputTestsalready covers the generator honouring the option once it arrives.No test changes. The suite passes.
Checklist
dotnet testlocally.