How to manually start $(Rev:r) counter from specif

2019-05-14 17:45发布

Say, I have a library which is already version 1.0.15

I migrate my build process to Azure DevOps, and want auto increment of build number. So in the build pipeline options, I set Build number format to 1.0.$(Rev:r).

But now it starts making builds at 1.0.1

So how do I artificially increment this to 15?

2条回答
萌系小妹纸
2楼-- · 2019-05-14 18:00

Add a variable in your build definition like this: enter image description here And then set the Build Number Format like following: enter image description here

You will get the counter to start from 15.

查看更多
霸刀☆藐视天下
3楼-- · 2019-05-14 18:06

Unfortunately, there is no such option to manually increment the $(Rev::r)

See this SO

As per the docs,

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.

If you want to show prefix zeros in the number, you can add additional 'r' characters. For example, specify $(rev:.rr) if you want the Rev number to begin with 01, 02, and so on.

查看更多
登录 后发表回答