guibranco / guibranco/MSBuild.Version.Target
[FEATURE] Support Single Version.txt File for Entire Solution
- Dominant language
- PowerShell
- Stars
- 5
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
#### Description
Currently, our MSBuild target generates a Semantic Version (SemVer) for each project in the solution based on individual `version.txt` files. This approach can lead to redundancy and inconsistencies when managing versioning across multiple projects.
To simplify version management, we propose allowing a single `version.txt` file to be used for the entire solution instead of requiring separate files for each project.
#### Proposed Changes
1. **Single Version File**:
- Introduce support for a centralized `version.txt` file located at the solution level, which all projects can reference for versioning.
- Ensure that the MSBuild target reads from this single file and generates the same SemVer for all projects in the solution.
2. **Backwards Compatibility**:
- Maintain support for existing projects that still use individual `version.txt` files.
- Implement logic to check for the presence of a solution-level `version.txt` and prioritize it over project-level files if both exist.
3. **Documentation Update**:
- Update the project documentation to reflect this new feature, including setup instructions for using the centralized versioning approach.
4. **Testing**:
- Create test cases to ensure that the versioning behaves as expected when using both the centralized and individual `version.txt` setups.
#### Benefits
- **Simplified Version Management**: Having a single version file reduces redundancy and makes it easier to manage versioning across multiple projects.
- **Consistency**: Ensures that all projects in the solution are using the same version number, preventing discrepancies and confusion.
- **Ease of Use**: Simplifies the process for developers, who will no longer need to update multiple version files for each release.
Contributor guide
Assessment
This issue has not been assessed yet.