TFS 2010 Multiple Solutions & Build with Gated Check
I have two solutions in their corresponding folder eg
SolutionASolutionsA.sln
SolutionBSolutionB.sln
Each solution has Gated Check-in build configured; ie two build definitions GatedSolutionA and GatedSolutionB.
Now the situation is, if I check in changes in both folders together TFS shows a dialog box to select build (drop down with GatedSolutionA, GatedSolutionB) to run against the changeset. My changeset has breaking changes in solution B and non-breaking changes in Solution A. ie Build GatedSolutionB would fail but GatedSolutionA would pass.
When I select GatedSolutionA to build against my changeset, TFS checks it in, which in turn leaves the solution B in broken state and purpose of Gated check-in is defeated for Solution B.
If I change the trigger to CI for build definitions, TFS queues both builds.
What I am looking for is same behaviour ie All the Gated builds are queued and if one of them fails, changeset should be rejected.
Note : I don't want to create single build definition for both the solutions. Also, I know we can avoid this problem to happen by creating two separate changesets, but this is generally happening when developers are not aware that they have some files being checked in for solution other than they are working on .
@Gchaves found a solution for that problem, you can go to "Edit Build Definitions" and on "Workspace" tab if you configure your "Source Control Folder" to the inner folder, where you have SolutionA.
For instance, if you have this file system:
Now if you configure "Source Control Folder" and "Build Agent Folder" to ProjectsSolutionA, the Gated check-in will only be triggered when you try to checkIn SolutionA, and it will only compile SolutionA.sln (for this to be true you must have to point just to SolutionA.sln on Process Tab ->1.Required->ProjectsToBuild)
And then you can have multiple solutions under same workspace, building, checking in and labeling independently:)
在Process选项卡中的构建定义中,您可以选择多个构建的sln。
One solution to this problem is for the developers to have separate workspaces mapped for the separate solutions. If there is no code overlapping between the solutions and you are trying to prevent a developer from checking into one solution when they are gated building another solution, then they should be using different workspaces.
If you have WorkspaceA for SolutionA and WorkspaceB for SolutionB, then the pending changes dialog will only show changes made to the appropriate workspace.
As you say, you know you can avoid it by using separate changesets. This is how you might "force" a developer to use two separate changesets and avoid the "developers are not aware..." situation.
Create the workspaces for them and revoke their "Create a workspace" permission so that they can't make one that includes both areas.
链接地址: http://www.djcxy.com/p/7818.html