-
-
Notifications
You must be signed in to change notification settings - Fork 86
Use MSBuild version comparison functions instead of numerical comparisons #2843
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
Conversation
…sons Replace direct numerical comparisons with MSBuild's built-in version comparison functions for better reliability and correctness. Changes: - Updated Directory.Build.targets to use MSBuild::VersionGreaterThanOrEquals for RoslynVersion comparisons - Changed $(RoslynVersion) >= 4.7 to $([MSBuild]::VersionGreaterThanOrEquals('$(RoslynVersion)', '4.7')) - Changed $(RoslynVersion) >= 4.14 to $([MSBuild]::VersionGreaterThanOrEquals('$(RoslynVersion)', '4.14')) Benefits: - Correct semantic version comparison (handles "4.10" > "4.9" properly) - Better compatibility across different MSBuild versions - Type-safe version comparisons 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Claude finished @thomhurst's task —— View job Code Review: MSBuild Version Comparison Changes ✅Todo List:
Changes SummaryFile: Before: <DefineConstants Condition="$(RoslynVersion) >= 4.7">$(DefineConstants);ROSLYN4_7_OR_GREATER</DefineConstants>
<DefineConstants Condition="$(RoslynVersion) >= 4.14">$(DefineConstants);ROSLYN4_14_OR_GREATER</DefineConstants> After: <DefineConstants Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(RoslynVersion)', '4.7'))">$(DefineConstants);ROSLYN4_7_OR_GREATER</DefineConstants>
<DefineConstants Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(RoslynVersion)', '4.14'))">$(DefineConstants);ROSLYN4_14_OR_GREATER</DefineConstants> Review Feedback✅ Code Quality & Best PracticesThis is an excellent improvement! The change replaces string-based numerical comparison with proper semantic version comparison:
✅ Bug FixesThis change fixes a significant bug: Problem with old approach:
Solution:
✅ Performance Considerations
✅ Security Concerns
✅ Test Coverage
RecommendationLGTM 🎉 This is a high-quality bug fix that:
The change is small, focused, and addresses a specific technical debt issue. Perfect example of defensive programming! Minor Suggestions
|
I can confirm that everything works in 0.55.0. Thanks for the fixes! |
@Brokolis fingers crossed!