Setting build parameters from external file in TeamCity

放肆的年华 提交于 2019-12-23 10:02:39

问题


I am currently setting the assembly version on all my C# assemblies using the TeamCity AssemblyInfo Patcher. The version scheme I chose is 'Major.Minor.%build.number%.0'. This works fine when I define Major and Minor numbers in TeamCity, but ideally I would like to have them already defined in my AssemblyInfo.cs file and have TeamCity only set the value for the build number. Is this possible?

One solution I see is to forsake using AssemblyInfo Patcher and use my own version update script, but that seems heavy-handed.


回答1:


You can define a parameters file which you check into version control, and then update the scheme to %system.major_version%.%system.minor_version%.%build_number%.0. Then you can keep using AssemblyInfo Patcher, but patch everything based on the values in the props file.

Just put the following in a file named teamcity.default.properties in your project root:

 system.major_version=3
 system.minor_version=15

This will result in the build number 3.15.1234.0 for build #1234.



来源:https://stackoverflow.com/questions/34593407/setting-build-parameters-from-external-file-in-teamcity

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