(#211) Ensure SolutionVersion.cs file is created #279
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description Of Changes
This commit addresses this issue by creating a new method named
GenerateSolutionVersionFile, which is called now from two places. The
first, where the code was previously, and the second is the if
statements which gates the running of GitVersion. Now, the "fake"
asserted version numbers are passed into this new method, which then
ensures that the SolutionVersion.cs is created, and the build continues.
Motivation and Context
There is a code path which can be executed where GitVersion is not
executed, i.e. when using:
./build.bat --ShouldRunGitVersion=false
When doing this, the code generates a "fake" set of version numbers,
however, those version numbers never made their way into a generated
SolutionVersion.cs file (which is "needed" to have a successful build.
Testing
Use the instructions on the internal wiki to run with the latest version of the Chocolatey.Cake.Recipe package, but replace the usage of the gitversion.cake file with the one from this PR.
./build.bat --ShouldRunGitVersion=falseOperating Systems Testing
Change Types Made
Change Checklist
Related Issue
Fixes #211