模块化团队构建 [英] Modular TeamBuilds

查看:30
本文介绍了模块化团队构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 3 个 TFS 构建版本(2 个 Dev 和 1 个 Cert).

I have 3 TFS Builds (2 Dev and 1 Cert).

我想将构建模块化,这样我就不必每次更改常用项目时都编辑 3 个文件.

I would like to modularize the builds so I don't have to edit 3 files each time I make a change to the common items.

我遇到的问题是只有构建文件夹中的项目(在 TeamBuildTypes 下)由 Team Build 自动检索.我可以在构建过程中输入代码来获取其他文件,但到那时为时已晚.

The problem I have is that Only the items in the build folder (under TeamBuildTypes) are automatically retrieved by the Team Build. I can put in code in my build process to get other files, but by then it is too late.

这是我的场景.我为常见任务创建了一个通用"位置.然后我去对该文件进行了更改.因为文件在我的构建过程告诉它下载之前不会下载,所以检索它为时已晚(导入已经发生并且 MSBuild 过程已经在内存中构建了构建目标).

Here is the scenario that I have. I make a "Common" location for common tasks. I then went and made changes to that file. Because the file does not down load until my build process tells it to down load it is retrieved too late (the import has already happened and the MSBuild process has constructed the build targets in memory).

我曾考虑将它添加到构建的工作区,但随后它将在 Get Sources 目标中检索(这也为时已晚).

I thought about adding it to the build's workspace, but then it will be retrieved in the Get Sources target (which is also too late).

我看不到不会让我复制文件或不使用源代码管理的解决方案...

I can't see a solution that will not have me duplicating the file or not using source control...

有什么想法吗?

推荐答案

在 Team Build 2008 中没有理想"的解决方案,你最好的选择是把通用的东西放在构建机器上的 $(MSBuildExtensionsPath) 解析为 C:Program FilesMSBuild 然后从那里引用它们.

There's no "ideal" solution to this problem in Team Build 2008, your best option is to put the common things on the build machine in $(MSBuildExtensionsPath) which resolves to C:Program FilesMSBuild and then reference them from there.

如果您的构建配置非常相似,您可以:

If your build configurations are very similar you could:

  1. 将所有构建定义指向一个配置文件夹.
  2. 将常用的构建逻辑放在TFSBuild.proj中.
  3. 在 TFSBuild.proj 底部添加 <Import Project="TFSBuild.$(BuildDefinitionName).proj"/>.
  4. 在 TFSBuild 中添加因构建定义而异的配置.<BuildDefinitionName>.proj.

这篇关于模块化团队构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆