Add version info to output assembly #22
Draft
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.
Resolves #20
Authorized contributors can contribute to this PR by checking out and pushing to
feat/gitVersion
.Version.rc resource file
On Windows, the File Version and Product Version properties (as well as others) in a File Properties tab are described by a C++ project's 'Version' resource.
A Version resource can be added to and modified in an existing assembly (EXE/DLL) or written to a project's Version.rc.
To write GitVersion variables to Version.rc before/during Link-time, we'll need to assign the variables to compile-time constants.
The File (GitVersion_FullSemVer) and Product (GitVersion_InformationalVersion) version variables (unless otherwise stated) must be assigned in two ways: string data and int-array data (1,0,5,0 (oh god why)).
I do not know how the informational version value (string) could be assigned to the Product Version int array, so I hope we don't actually need the int arrays.
I'd prefer having GitVersion's variables available before and during Link-time so the version information can be tested locally.
Placeholder .NET project
After some investigation, this is not possible.
Version.rc/.h is the only way to add File Version and Product Version data in an unmanaged project.
This requires less effort on my end, but may be unusual compared to other C++ projects' methods of versioning.1. Apply version information to a dotnet project targeting .NET 4.8, build that project before the C++ project2. Use a certain C++ Linker feature to grab the .NET assembly's version info which the Linker then uses to overwrite the C++ assembly's version info.Documentation and References
GitVersion_
.