-
-
Notifications
You must be signed in to change notification settings - Fork 2
Refactor to UsingTask Override #51
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
dorssel
commented
Dec 6, 2025
- Use GitVersion.MsBuild package instead of dotnet-gitversion tool
- Only activate for WiX projects and building in Visual Studio
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #51 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 3 -1
Lines 115 36 -79
Branches 11 3 -8
=========================================
- Hits 115 36 -79 ☔ View full report in Codecov by Sentry. |
✅MegaLinter analysis: Success
See detailed reports in MegaLinter artifacts You could have the same capabilities but better runtime performances if you use a MegaLinter flavor:
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining
|
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.
Pull request overview
This PR refactors the project to use the GitVersion.MsBuild NuGet package with a UsingTask override approach instead of the dotnet-gitversion tool. The package now serves as an addition to the original GitVersion.MsBuild, specifically for building WiX projects in Visual Studio, rather than a full replacement.
- Switched from dotnet-gitversion CLI tool to GitVersion.MsBuild package
- Implemented UsingTask override mechanism to selectively activate only for WiX projects built in Visual Studio
- Removed GenerateGitVersionInformation functionality and related code
- Replaced Example C# console app with WiX installer project
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| global.json | Added WixToolset.Sdk 6.0.2 to msbuild-sdks |
| .config/dotnet-tools.json | Removed gitversion.tool dependency |
| Directory.Packages.props | Added GitVersion.MsBuild 6.5.1 package version |
| Directory.Build.props | Added GitVersion.MsBuild package reference, removed bootstrapping logic |
| Directory.Build.targets | Removed file (self-reference logic moved to dedicated files) |
| SelfReference.props | New file providing self-reference props for projects in the repo |
| SelfReference.targets | New file providing self-reference targets for projects in the repo |
| GitVersion.MsBuild/build/Dorssel.GitVersion.MsBuild.props | Simplified to only activate for WiX projects in Visual Studio, disabled unsupported features |
| GitVersion.MsBuild/build/Dorssel.GitVersion.MsBuild.targets | Refactored to use UsingTask override with conditional activation |
| GitVersion.MsBuild/GenerateGitVersionInformation.cs | Removed entire file as functionality is no longer supported |
| UnitTests/UnitTests.csproj | Added self-reference imports |
| UnitTests/TaskTests.cs | Removed tests for deleted GenerateGitVersionInformation functionality |
| gitversion-msbuild.slnx | Replaced Example.csproj with Example.wixproj, added self-reference files |
| Example/Example.csproj | Removed C# console application |
| Example/Example.wixproj | New WiX installer project demonstrating GitVersion integration |
| Example/Package.wxs | WiX package definition using GitVersion variables |
| Example/Package.en-us.wxl | WiX localization file |
| Example/Folders.wxs | WiX folder structure definition |
| Example/ExampleComponents.wxs | WiX component group definition |
| Example/Program.cs | Removed C# example code |
| README.md | Updated documentation to reflect new purpose and usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
75776e8 to
606c9b1
Compare
- Use GitVersion.MsBuild package instead of dotnet-gitversion tool - Only activate for WiX projects *and* building in Visual Studio +semver: major
