好的,我知道这可能不是传统的,但除此之外:我使用 AssemblyFileVersion 作为我的“构建名称”字符串。它的格式如下:
' File Version information for an assembly consists of the following four values:
'
' Year
' Month
' Day
' Commit Number for that day
'
' Build Name can either be alpha | beta | hotfix | release
' alpha - is a development buildname with rapid changing API
' beta - is a production build for our beta users
' hotfix - is a production version with a bug fix
' release - is a standard issue production version.
<Assembly: AssemblyVersion("0.8.3")>
<Assembly: AssemblyFileVersion("13.10.24.3")>
<Assembly: AssemblyBuildName("alpha")>
不幸的是,我每次执行git提交时都必须调整 AssemblyInfo.vb 。现在我知道 GIT 实际上将提交存储在 .git 目录中多个位置的日志文件中。我的问题是:无论如何要自动化这个文件以从 git 文件中读取以查看年/月/日/commit#ForThatDay 并自动调整 AssemblyFileVersion (甚至是自定义 Assembly 属性)?