https://github.com/smourier/updateassemblyinfo
Updates AssemblyFileVersion from a .cs file.
https://github.com/smourier/updateassemblyinfo
assembly autoversion githook versioning
Last synced: 16 days ago
JSON representation
Updates AssemblyFileVersion from a .cs file.
- Host: GitHub
- URL: https://github.com/smourier/updateassemblyinfo
- Owner: smourier
- License: mit
- Created: 2021-12-06T15:01:22.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-01-04T14:06:27.000Z (over 1 year ago)
- Last Synced: 2025-03-05T03:44:40.769Z (about 1 year ago)
- Topics: assembly, autoversion, githook, versioning
- Language: C#
- Homepage:
- Size: 28.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UpdateAssemblyInfo
Updates `AssemblyFileVersionAttribute` assembly attribute (and only that) from a .cs file. For example this file :
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.100")]
Will be changed into this file:
[assembly: AssemblyVersion("1.0.0.0")] // this is not changed
[assembly: AssemblyFileVersion("1.0.0.101")]
It can be used with a git pre-commit hook https://stackoverflow.com/questions/17101473/change-version-file-automatically-on-commit-with-git
Exemple: of a pre-commit hook (the file must be named "pre-commit" and put in the .git/hooks folder, and copy UpdateAssemblyInfo.exe somewhere in the PATH):
#!/bin/sh
#
# update AssemblyInfoVersion.cs
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
UpdateAssemblyInfo.exe "Properties/AssemblyInfo.cs"
git add "Properties/AssemblyInfo.cs"