模块化 TeamBuilds [英] Modular TeamBuilds

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

问题描述

我有 3 个 TFS 版本(2 个开发和 1 个证书).

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..proj 中添加因构建定义而异的配置.
  1. Point all of your build definitions to a single configuration folder.
  2. Put the common build logic in TFSBuild.proj.
  3. At the bottom of TFSBuild.proj add <Import Project="TFSBuild.$(BuildDefinitionName).proj" />.
  4. Add the configuration that varies between build definitions in TFSBuild.<BuildDefinitionName>.proj.

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

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