Team build: Use same external targets for multiple build definitions
I want to use the same targets defined in an external file in multiple build definitions. This external target file should be stored on the source control. The bootstrap phase explained in TFSBuild.proj and Importing External Targets does not seem to allow downloading the same file for multiple build definition as the build file is always named TFSBuild.proj and consequently sits in a separate folder for each build definition.
The question was somewhat aked in a comment of the previouly mentionned thread but it seems motre appropriate to create a new thread.
Quoting that comment by David Keaveny:
Is it possible to get TFS to download from other folder paths during bootstrap? I have a Common.targets file that contains all the custom tasks that my TFSBuild.proj should be executing, but gi开发者_开发知识库ven that I several build definitions (one folder per definition), it sits in a separate folder at the same level as the build definitions. Without it, of course, the builds fail immediately. – David Keaveny Aug 17 '10 at 23:58
I'm not sure if there is an easy way to do this. You could have a master copy of the targets file, and branch that in to each of your build definition folders. When you update the targets file you'd need to remember to merge it to all of the folders. You could probably write a script that automates the merging, the script should be able to work out what the branching relationships are using tf branches
and then iterate around them and call tf merge
then tf checkin
. This feels like a lot of work though.
You could just install the target on your build server(s). We have a number of custom targets that we use and we manage them as if they were a product, they have their own area for source control and are versioned independently of the software they are used to build. We package them using wix and once they have been tested they are installed on all of the build machines. This seems to work for us and it means we can control the rollout of new targets files, and the targets install is just part of a build server basline build.
I'd be very interested if someone has an easier way of managing this though.
精彩评论