-
Notifications
You must be signed in to change notification settings - Fork 33
Closed
Description
Objective
Implement multi-Roslyn configuration support in src/DocoptNet/DocoptNet.csproj so the project can build analyzer outputs for baseline Roslyn (3.10.0) and Roslyn 4.4.0, with safe packing behavior.
Scope
- Add
RoslynVersion-conditioned property group for Roslyn 4.4 build isolation. - Keep baseline behavior unchanged when
RoslynVersionis not set. - Split
Microsoft.CodeAnalysis.CSharppackage reference into conditional versions (3.10.0 vs 4.4.0). - Add pack item for
analyzers/dotnet/roslyn4.4/cs/DocoptNet.dll. - Add pre-pack validation target that errors if Roslyn 4.4 analyzer output is missing.
Files
src/DocoptNet/DocoptNet.csproj
Tasks
- Add conditioned
PropertyGroupforRoslynVersion == 4.4:- Set
BaseOutputPathto an isolated Roslyn 4.4 path. - Set
BaseIntermediateOutputPathto an isolated Roslyn 4.4 path. - Add
DefineConstantsentry forROSLYN4_4.
- Set
- Replace unconditional
Microsoft.CodeAnalysis.CSharpreference with two conditioned references:- 3.10.0 for default/empty
RoslynVersion. - 4.4.0 when
RoslynVersionis4.4.
- 3.10.0 for default/empty
- Add second analyzer pack item for
analyzers/dotnet/roslyn4.4/csusing MSBuild property-based paths. - Add
_ValidateRoslyn44AnalyzerOutputtarget (BeforeTargets="GenerateNuspec") with clear remediation message.
Acceptance Criteria
-
dotnet buildat repo root still produces baseline artifacts with noRoslynVersionrequired. -
dotnet build src/DocoptNet/DocoptNet.csproj -f netstandard2.0 -p:RoslynVersion=4.4succeeds and emits isolated output. -
dotnet pack src/DocoptNet/DocoptNet.csprojfails with explicit guard message if Roslyn 4.4 analyzer output is absent. - Changes do not alter
lib/target framework outputs.
Dependencies
- None.
Notes
- Use project-relative properties (
$(MSBuildProjectDirectory),$(BaseOutputPath), etc.) and avoid hard-coded path separators.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels