问题描述
我在我的版本号中使用了 $(Rev:.r).
I am using $(Rev:.r) in my build number.
Major.Minor$(Rev:.r)
Major.Minor$(Rev:.r)
这很完美,并且会在每次构建时递增,如果主要或次要版本发生更改,则会重置.
This works perfect and increments on every build and gets reset if the the major or minor version gets changed.
但是编号从 1 而不是 0 开始.所以第一个版本不是 1.0.0 而是 1.0.1,这不是我真正想要的.
But the numbering starts at 1 and not 0. So the first build is not 1.0.0 but 1.0.1 which is not really what I am going for.
那么有没有办法让 Revision 从 0 开始?
So is there a way to make the Revision start at 0?
感谢您的帮助...
附言不幸的是,在这个项目中无法使用 Git 和 GitVersion.
P.S. Unfortunately it is not possible to use Git and GitVersion in this project.
推荐答案
不,这无法实现.
什么是牧师?
使用 $(Rev:.rr) 确保每个完成的构建都有唯一的名称.构建完成后,如果构建编号中没有其他内容更改后,Rev 整数值加一.
Use $(Rev:.rr) to ensure that every completed build has a unique name. When a build is completed, if nothing else in the build number has changed, the Rev integer value is incremented by one.
源链接:构建数字格式
此外,每当您在 TFS 版本中更改版本号时,修订版都会重置为 1.默认情况下,您无法更改此值.既然可以设置从0开始的值,那也应该可以设置从100开始.这样会搞乱构建号.
Moreover, anytime you change your Build Number in a TFS build, the revision resets to 1. It' by default, you could not change this value. Since if you could be able to set the value start from 0, it's also should be able to set it start from 100. This will mess up the build number.
这篇关于TFS Online - 从 0 开始 $(Rev.r)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!