问题描述
我有3个TFS Build(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.
我遇到的问题是,Team Build仅自动检索build文件夹(在TeamBuildTypes下)中的项目.我可以在构建过程中加入代码以获取其他文件,但是那时为时已晚.
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).
我曾考虑过将其添加到构建的工作区中,但是随后将在获取源"目标中检索它(也为时已晚).
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 Files\MSBuild
,然后从那里引用它们.
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 Files\MSBuild
and then reference them from there.
如果您的构建配置非常相似,则可以:
If your build configurations are very similar you could:
- 将所有构建定义都指向一个配置文件夹.
- 将通用的构建逻辑放入
TFSBuild.proj
. - 在TFSBuild.proj的底部添加
<Import Project="TFSBuild.$(BuildDefinitionName).proj" />
. - 添加在TFSBuild中的构建定义之间不同的配置.
<BuildDefinitionName>.proj
.
- Point all of your build definitions to a single configuration folder.
- Put the common build logic in
TFSBuild.proj
. - At the bottom of TFSBuild.proj add
<Import Project="TFSBuild.$(BuildDefinitionName).proj" />
. - Add the configuration that varies between build definitions in TFSBuild.
<BuildDefinitionName>.proj
.
这篇关于模块化团队建设的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!