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?
Add a variable in your build definition like this:
And then set the Build Number Format like following:
You will get the counter to start from 15.
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.