使用Nant将TeamCity内部版本号获取到AssemblyInfo文件中

编程入门 行业动态 更新时间:2024-10-28 02:24:11
本文介绍了使用Nant将TeamCity内部版本号获取到AssemblyInfo文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经进行了大量谷歌搜索,但似乎找不到确切的解决方案将TeamCity内部版本号输入到我的AssemblyInfo文件中.希望能为我的要求提供完整的解决方案...

I have done a lot of googling but cant seem to find an exact solution to get the TeamCity build number into my AssemblyInfo files. Would appreciate a full solution for my requirements...

1将内部版本号放入Nant变量中.我相信这段代码将完成此任务.

1 Get the build number into a Nant variable. I believe that this code will accomplish this..

PropertyGroup Version$(BUILD_NUMBER)/Version /PropertyGroup

(在SO中尽可能重复).

(repoduced as best as possible in SO).

2现在,我需要一种方法来更新版本号的修订组件,以便获得1.0.0.[内部版本号]之类的信息.

2 Now I need a way to update the revision component of my version numbers so I get something like 1.0.0.[build number].

3理想情况下,我需要将整个对象放在可重复使用的Nant目标中,以便可以将其传递到要更新的程序集信息文件的路径中.

3 Ideally I need the whole thing in a re-usable Nant target so that I can just call it passing in the path to the assembly info file that i want to update.

如果您可以帮助我,请在此处发布完整的解决方案,并附上说明,而不是指向其他网站的链接.我已经看了很多在线示例,但似乎找不到适合我需要的示例-因此,我要求了解无所不能的SO社区!

I would respectfully request that if you can help me that a full solution is posted here with explanation as opposed to links to other sites. Ive looked at a lot of online examples but cant seem to find one that fits what I need - therefore I request the knowledge of the omnipotent SO community!

谢谢.

推荐答案

首先,问题中的代码段是MSBuild语法,而不是NAnt.假设NAnt是您的构建工具,那么如何使用Cruise Control.NET 此处.这同样适用于TeamCity,只需将"CCNetLabel"替换为"build.number",就可以了.

First of all, the code snippet in your question is MSBuild syntax, not NAnt. Assuming that NAnt is your build tool, there is a good explanation of how to update AssemblyInfo files with Cruise Control.NET here. That applies to TeamCity as well, just replace "CCNetLabel" with "build.number" and you will be fine.

要获得1.0.0.[内部版本号]之类的版本号,可以在TeamCity内部版本配置中完成.在第一个配置页面上(常规设置).将内部版本号格式"从"{0}"更改为"1.0.0.{0}".有关更多选项,请参见在线帮助.

To get a version number like 1.0.0.[build number], you can accomplish that in the TeamCity build configuration. On the first configuration page (General Settings). Change the "Build Number Format" from "{0}" to "1.0.0.{0}". See the online help for more options.

更多推荐

使用Nant将TeamCity内部版本号获取到AssemblyInfo文件中

本文发布于:2023-11-04 00:31:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1556468.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:版本号   文件   Nant   TeamCity   AssemblyInfo

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!