Modify TFS 2015 BuildNumber during build process

蓝咒 提交于 2019-11-29 14:35:55

TL;DR; You can either use the build number format as you have above, or create a custom build number...not both.

create custom build number during build

With Team Build you can update the build number at any time during the build by outputing "##vso[build.updatebuildnumber]1.2.3.4" to the log during the build.

You can see the full list of logging commands here https://github.com/Microsoft/vso-agent-tasks/blob/master/docs/authoring/commands.md

This will update the build number & name.

The down side that you have run into is that you can no longer use the auto-incrementing number that you have been trying to use. You need to come up with the version number yourself, and then pass it back using the output above.

use auto-created build number in your build

You can however use the auto-incrementing to have the build system create a version number and then write it into the locations you need..

https://www.visualstudio.com/en-us/docs/build/scripts/

recommend to use GitVersion

If you are using Git you can use GitVersion to create Semantic or auto-incrementing numbers for you during a build. Or you can use a file to specify the number explicitly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!