-
Notifications
You must be signed in to change notification settings - Fork 11
Add support for .slnx solution format #463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Upgraded dependencies and target framework to enable full support for the new XML-based .slnx solution format in both Workspace and Static Graph build engines. Changes: - Upgraded MSBuild from 17.11.48 to 17.14.28 (.slnx support added in 17.12.6) - Upgraded Roslyn from 4.14.0 to 5.0.0-2.final (.slnx support added in this version) - Upgraded target framework from net8.0 to net9.0 (required by MSBuild 17.12.6+) - Added Microsoft.CodeAnalysis.Common package reference - Updated deprecated Workspace.WorkspaceFailed API to RegisterWorkspaceFailedHandler - Added test coverage for .slnx format in both WorkspaceSlnx and StaticGraphSlnx test classes All tests passing (14/14 .slnx tests). Fixes petabridge#405
Roslyn 5.0+ no longer supports loading F# projects even with AssociateFileExtensionWithLanguage workaround. Changes: - Switched F# test to use StaticGraphBuildEngine (which uses MSBuild's ProjectGraph API) - Added workspace configuration with SkipUnrecognizedProjects=false - Added diagnostic logging for loaded projects - Updated F# test project samples from netcoreapp2.2 to net8.0 StaticGraphBuildEngine works with F# projects because it doesn't rely on Roslyn's language-specific support. All 143 tests now passing.
Aaronontheweb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Detailed my changes
| <PackAsTool>true</PackAsTool> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <TargetFramework>net9.0</TargetFramework> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to run on .NET 9 in order to access some of the newer Roslyn APIs
| private readonly MSBuildWorkspace _msBuild = MSBuildWorkspace.Create(); | ||
| private readonly MSBuildWorkspace _msBuild = CreateWorkspace(logger); | ||
|
|
||
| private static MSBuildWorkspace CreateWorkspace(ILogger logger) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the non-default MSBuild implementation
| public const string ProjectC = "ProjectC"; | ||
|
|
||
| private static TestSolutionModel CreateSolution() | ||
| private static TestSolutionModel CreateSolution(SolutionFormat format = SolutionFormat.Sln) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it possible to emit both .sln and .slnx solutions
| var settings = new BuildSettings("master", new RelativePath("FSharpSolution.sln"), Repository.BasePath, [], | ||
| [], "dotnet"); | ||
| var emitTask = new EmitDependencyGraphTask(settings, new WorkspaceBuildEngine(logger), logger, CancellationToken.None); | ||
| // Note: Using StaticGraphBuildEngine instead of WorkspaceBuildEngine because Roslyn 5.0+ does not support F# projects |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to make this clearer in the release notes
| <Authors>Petabridge</Authors> | ||
| <VersionPrefix>1.1.0</VersionPrefix> | ||
| <PackageReleaseNotes>**Major New Features & Improvements:** | ||
| <VersionPrefix>1.2.0-beta.1</VersionPrefix> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dotnet pack will complain about us referencing a non-stable package if we're trying to build a stable release version.
Summary
Adds full support for the new XML-based .slnx solution format in both Workspace and Static Graph build engines.
Changes
Workspace.WorkspaceFailedAPI toRegisterWorkspaceFailedHandlerWorkspaceSlnxtest class (6 tests)StaticGraphSlnxtest class (6 tests)Test Results
All 14 .slnx tests passing:
Fixes #405