You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sub-issue of #267. Independent of Phases 4 (#293) and 5 (#294); prerequisite for Phase 7 (the NBGV swap), which turns this on and feeds it the version values. Lands dormant (off by default) so it carries no behavior risk and does not collide with NBGV's own ThisAssembly.
Scope
Restore the ThisAssemblyClass SDK module (removed in PR Replace code generation tasks with source generators #158, last present at v1.0.0-alpha.20) as src/Buildvana.Sdk/Modules/ThisAssemblyClass/Module.targets, recovered from the pre-removal state and registered in the SDK's module imports. Off by default: GenerateThisAssemblyClass defaults false; the EnableDefaultThisAssemblyConstants knob is preserved.
Restore + refactor the ThisAssembly class source generator into Buildvana.Sdk.SourceGenerators, modernized to the current incremental-generator style and reusing the constant-value parsing already shared with AdditionalAssemblyInfoGenerator / AdditionalAssemblyInfoValues (the type:value syntax in docs/ConstantsSyntax.md) — no parallel parser. Preserve CompilerGenerated + ExcludeFromCodeCoverage on the generated class. C# only: VB support is not restored; BVW1900 is emitted on any non-C# language.
No version coupling yet: the generator emits only user-declared ThisAssemblyConstants (plus existing defaults); wiring version values in is Phase 7. The AdditionalAssemblyInfo module (literal assembly attributes) is untouched — only the ThisAssembly class feature returns.
Dormant / no conflict: with GenerateThisAssemblyClass off by default, no project — including this repo, still built by the NBGV-based published SDK — generates a Buildvana ThisAssembly, so there is no collision with NBGV's.
Docs: docs/ConstantsSyntax.md already documents the feature; refresh to reflect C#-only support (and any restored-surface differences).
Acceptance criteria
A C# project opting in with GenerateThisAssemblyClass=true and ThisAssemblyConstant items gets a correct generated ThisAssembly class, with the documented value-parsing and the CompilerGenerated/ExcludeFromCodeCoverage attributes; default-off projects generate nothing.
BVW1900 is emitted for non-C# languages (including VB); default constants honor EnableDefaultThisAssemblyConstants.
NBGV remains in use and unaffected; dotnet bv build self-hosts with the generator off.
Generator unit tests pass in CI.
CHANGELOG: Unreleased "Added" entry — the ThisAssemblyClass module / GenerateThisAssemblyClass is reintroduced (default off, C# only); additive, not breaking.
Sub-issue of #267. Independent of Phases 4 (#293) and 5 (#294); prerequisite for Phase 7 (the NBGV swap), which turns this on and feeds it the version values. Lands dormant (off by default) so it carries no behavior risk and does not collide with NBGV's own
ThisAssembly.Scope
ThisAssemblyClassSDK module (removed in PR Replace code generation tasks with source generators #158, last present atv1.0.0-alpha.20) assrc/Buildvana.Sdk/Modules/ThisAssemblyClass/Module.targets, recovered from the pre-removal state and registered in the SDK's module imports. Off by default:GenerateThisAssemblyClassdefaultsfalse; theEnableDefaultThisAssemblyConstantsknob is preserved.Buildvana.Sdk.SourceGenerators, modernized to the current incremental-generator style and reusing the constant-value parsing already shared withAdditionalAssemblyInfoGenerator/AdditionalAssemblyInfoValues(thetype:valuesyntax in docs/ConstantsSyntax.md) — no parallel parser. PreserveCompilerGenerated+ExcludeFromCodeCoverageon the generated class. C# only: VB support is not restored; BVW1900 is emitted on any non-C# language.ThisAssemblyConstants (plus existing defaults); wiring version values in is Phase 7. TheAdditionalAssemblyInfomodule (literal assembly attributes) is untouched — only the ThisAssembly class feature returns.GenerateThisAssemblyClassoff by default, no project — including this repo, still built by the NBGV-based published SDK — generates a BuildvanaThisAssembly, so there is no collision with NBGV's.Acceptance criteria
GenerateThisAssemblyClass=trueandThisAssemblyConstantitems gets a correct generatedThisAssemblyclass, with the documented value-parsing and theCompilerGenerated/ExcludeFromCodeCoverageattributes; default-off projects generate nothing.EnableDefaultThisAssemblyConstants.dotnet bv buildself-hosts with the generator off.ThisAssemblyClassmodule /GenerateThisAssemblyClassis reintroduced (default off, C# only); additive, not breaking.