-
-
Notifications
You must be signed in to change notification settings - Fork 988
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
feat: Add support for solution filter files (.slnf) and fix version detection in launcher #2676
base: master
Are you sure you want to change the base?
feat: Add support for solution filter files (.slnf) and fix version detection in launcher #2676
Conversation
…etection in launcher
sources/core/Stride.Core.Design/VisualStudio/SolutionFilterReader.cs
Outdated
Show resolved
Hide resolved
sources/core/Stride.Core.Design/VisualStudio/SolutionFilterReader.cs
Outdated
Show resolved
Hide resolved
return packageVersion; | ||
} | ||
} | ||
else if (Regex.IsMatch(Path.GetExtension(fullPath), @"\.slnf?$", RegexOptions.IgnoreCase)) |
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.
Consider using a compile-time regex.
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.
Moved the regex to a static readonly field.
public static readonly Regex SolutionFileRegex = new(@"\.slnf?$", RegexOptions.IgnoreCase | RegexOptions.Compiled);
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.
I was more thinking of using the new GeneratedRegex
attribute that triggers a source generator.
See
stride/sources/core/Stride.Core.Design/PackageVersion.cs
Lines 26 to 32 in 665a05e
#if NET7_0_OR_GREATER | |
private static readonly Regex SemanticVersionRegex = GetSemanticVersionRegex(); | |
private static readonly Regex StrictSemanticVersionRegex = GetStrictSemanticVersionRegex(); | |
#else | |
private static readonly Regex SemanticVersionRegex = new Regex(@"^(?<Version>\d+(\s*\.\s*\d+){0,3})(?<Release>-[0-9a-z]*[\.0-9a-z-]*)?(?<BuildMetadata>\+[0-9a-z]*[\.0-9a-z-]*)?$", Flags); | |
private static readonly Regex StrictSemanticVersionRegex = new Regex(@"^(?<Version>\d+(\.\d+){2})(?<Release>-[0-9a-z]*[\.0-9a-z-]*)?(?<BuildMetadata>\+[0-9a-z]*[\.0-9a-z-]*)?$", Flags); | |
#endif |
stride/sources/core/Stride.Core.Design/PackageVersion.cs
Lines 357 to 362 in 665a05e
#if NET7_0_OR_GREATER | |
[GeneratedRegex(@"^(?<Version>\d+(\s*\.\s*\d+){0,3})(?<Release>-[0-9a-z]*[\.0-9a-z-]*)?(?<BuildMetadata>\+[0-9a-z]*[\.0-9a-z-]*)?$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture)] | |
private static partial Regex GetSemanticVersionRegex(); | |
[GeneratedRegex(@"^(?<Version>\d+(\.\d+){2})(?<Release>-[0-9a-z]*[\.0-9a-z-]*)?(?<BuildMetadata>\+[0-9a-z]*[\.0-9a-z-]*)?$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture)] | |
private static partial Regex GetStrictSemanticVersionRegex(); | |
#endif |
…ction, use naming policy for JSON deserialization and improve null checks
so changing an excluded project still triggers reload? |
Good point. I extended the This following {
"solution": {
"path": "MyGame.sln",
"projects": [
"MyGame.Android\\MyGame.Andriod.csproj",
"MyGame.Windows\\MyGame.Windows.csproj"
]
}
} |
changing something in an exlcuded project will still trigger reload as the projectwachre has is own roslyn workspace |
Yes, the reload work as before in all loaded projects. This means all project from the solution filter file and their dependencies. |
…for parent project retrieval
I fixed the path set to the solution object to the filter file instead of the referenced solution. Restarting the editor then opens the filtered solution instead of the complete solution. |
the projectwatcher watches the files and reacts on typing,, and has his own msbuild workspace so, if i change an excluded project it will still cause a reload also check if with your changes reloading works, also reloading chained projects like sub projects in your solution should trigger a reload chain |
The reload works with solution files same as with solution filter files because there is no difference after determining the projects to load. I tested the reload and it is working in simple projects, same as when opening |
the projectwatcher wasnt buggy before thats why or atleast not in way that i know of |
https://github.com/stride3d/stride/blob/master/sources/editor/Stride.Assets.Presentation/AssetEditors/ProjectWatcher.cs#L385 |
additionally you have in the projectwatcher https://github.com/stride3d/stride/blob/master/sources/editor/Stride.Assets.Presentation/AssetEditors/ProjectWatcher.cs#L63 |
PR Details
Add support for solution filter files (
*.slnf
) to open a subset of projects of a solution.Fixed the version detection in the launcher for last opened sdpkg files.
Related Issue
Solves #2675
Types of changes
Checklist