开发者

TFS 2010 Build Definition

In the TFS 2010 build definition window, under “Process” there are two required items. They are “Configurations to build” and “Projects to build”. Under projects to build, it will allow me to enter something like:

$/TeamProject/Area1/Area2/*

However, this doesn’t seem to do what I expect. The build fails because it’s looking for:

$/TeamProject/Area1/Area2/Sources/*

What I am trying to achieve by this is to build all the solut开发者_Python百科ions held under this area. For example, I have:

$/TeamProject/Area1/Area2/Solution1/Solution1.sln
$/TeamProject/Area1/Area2/Solution2/Solution2.sln
$/TeamProject/Area1/Area2/Solution3/Solution3.sln

There are many more solutions than this, which is why I’m looking for a way to build all solutions under the specified path recursively. Is there a way to do this in TFS 2010?


You can modify the process template. Expand it with the Matching files (I don't have the exact naming now) activity. Add a parameter that passes the information you set in the build defintion to the MachingFiles actvity. Then pass into the build solution activity instead of the argument that you enter in the build definition the files that is found by the MatchingFiles activity.

Now add a dummy solution in the build definition for the solution to build (it is not used anymore).

See the blog post series on the build customization for more information on customizing the build process template.


FWIW, I've got: "configurations to build" blank and under "projects to build" I've added my solutions via the ellipsis button


I would setup mappings for

$/TeamProject/Area1/Area2/Solution1/    
$/TeamProject/Area1/Area2/Solution2/    
$/TeamProject/Area1/Area2/Solution3/

Then in the build definitions enter the three projects to build

$/TeamProject/Area1/Area2/Solution1/Solution1.sln
$/TeamProject/Area1/Area2/Solution2/Solution2.sln
$/TeamProject/Area1/Area2/Solution3/Solution3.sln

You can leave the configurations to build as blank, or if you want to do a certain build you can set it to (for example) something like Debug|Mixed Platforms (check your Configuration Manager... for the solutions you are building to see what is valid)

Alternatively, you can just map the following (depending on how much you have in this folder, if you have Solutions 4+ that you don't want to trigger builds on, don't do it at this level)

$/TeamProject/Area1/Area2

And have one solution which contains the Solution1, Solution2 and Solution3, and build that instead.

By default building your Solution1 which is mapped to

$/TeamProject/Area1/Area2

On a build agent with a working directory that is going to looks something like:

$(SystemDrive)\Builds\$(BuildAgentId)\$(BuildDefinitionPath)

You'll end up with it being build under

C:\Builds\1\Solution1\Binaries
C:\Builds\1\Solution1\Sources
C:\Builds\1\Solution1\TestResults

Which is why you want to make sure that your OutDir's etc are all correct and not hard coded!

If you have a look while building, you'll see the build agent populating the Sources folder, and it should (if configured correctly) put all outputs into the Binaries folder (and then copy them to the Drop Folder configured under Build Defaults in TFS.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜