需要有关版本号方案的帮助

发布于 2024-09-02 22:27:16 字数 650 浏览 2 评论 0原文

我知道标准的 Major.Minor.Build.Revision,但我们有几个有些独特的考虑因素

- 我们几乎每天都会进行内部发布,有时每天不止一次。

-Windows Installer 不检查修订 所以这对于我们的目的来说几乎毫无意义。

- 理想情况下,主要和次要数字仅针对公开发布进行更新,并且应手动完成。

- 剩下的构建号需要自动更新。

-我们希望内部发布能够在任何开发人员的机器上执行,这样就不用在 Visual Studio 中使用 xx*,因为不同的机器可能会生成不同的数字,并且每个构建都不能保证比前一个更大。

-我们有大约 15 个左右的项目作为产品的一部分,因此在 SVN 中保存版本号并不理想,因为每个版本我们都会提交所有这些文件。

考虑到这些标准,我真的无法想出一个好的版本控制方案。最后两个标准可以放弃,但满足所有这些标准似乎是理想的。日期戳是不够的,因为我们每天可能会做不止一个,并且考虑到 Uint16 的最大大小(大约 64000)(实际上使用 WiX 它会抱怨数字高于 Int16.MaxValue),日期/时间将不适合。

I know the standard Major.Minor.Build.Revision but there's several considerations for us that are somewhat unique

-We do internal releases almost daily, occasionally more than once a day.

-Windows Installer doesn't check Revision so that's almost moot for our purposes.

-Major and Minor numbers ideally are only updated for public releases and should be done manually.

-That leaves the Build # that needs to be automatically updated.

-We want internal releases to be able to be performed from any developer's machine so that leaves out using x.x.* in Visual Studio because different numbers could be generated from different machines and each build isn't guaranteed to be larger than the previous.

-We have about 15 or so projects as part of the product so saving the version numbers in SVN isn't ideal since every release we'd have commit all those files.

Given those criteria I can't really come up with a good versioning scheme. The last 2 criteria could be dropped but meeting all of those seems ideal. A date stamp is insufficient because we might do more than one a day, and given the max size of Uint16 (around 64000) (Actually using WiX it complains about numbers higher than Int16.MaxValue) a date/time won't fit.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

你曾走过我的故事 2024-09-09 22:27:16
  1. 使用 SVN 提交编号或其他提交 ID(我们通常使用 git describe 输出,这在大多数情况下是完美的)。构建应该是可追踪的 - 如果您希望真正能够确定正在运行的内容,那么仅从提交的源进行构建很重要。
  2. 使用秒精度的时间/日期(UNIX 纪元时间)。这将一直有效到 2038 年。如果数字太大,请使用不同的纪元(例如 2000 年)。

此外,Uint32 不限于 2^16 (65535),它的 32 位为您提供 2^32,或大约 40 亿。

  1. Use SVN commit numbers, or other commit IDs (we usually use git describe output, which is perfect in most cases). Builds should be traceable - its important to only build from committed sources if you want to actually be able to determine what you are running.
  2. Use the time/date in second precision (UNIX epoch time). This will work for you until 2038. If the number is too big, use a different epoch (such as the year 2000).

Also, Uint32 is not limited to 2^16 (65535), its 32 bit giving you 2^32, or roughly 4 billion.

凉月流沐 2024-09-09 22:27:16

由于 msi 不检查修订版本,因此我们在 msi 的构建系统中切换了第三和第四版本部分。

例如,如果真实版本是 1.2.3.4678(4678 是构建应用程序的 SVN 版本),我们将 msi 版本创建为 1.2.4678.3。

Since msi doesn't check revisions, we switched the third and fourth version part in our build system for the msi.

For example, if the real version is 1.2.3.4678 (the 4678 is the SVN revision the app is built from), we create the msi version as 1.2.4678.3.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文