Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS 2010 Build get part of workspace based on a label

I've got an automated build in TFS 2010 with the following workspace:

$/Program 1   $(SourceDir)\Program 1
$/Core        $(SourceDir)\Core

I then build both the core projects and the program 1 specific projects as part of the build. However, in doing bug fixes for a previous version, I need to get a specific label of the core files, but the latest for program 1 files. How can I change the workspace for only the Core directory to get by the label instead of getting the latest.

I know I can create a branch from the label for the Core folder, but since the bug fix is only in the Program 1 files, I don't want to create a new branch that has no changes in it.

like image 263
Ezweb Avatar asked Nov 20 '25 18:11

Ezweb


1 Answers

So you have an Solution that imports code from different TeamProjects.
That's not quite an optimum setup, one more flexible alternative could be the following:

$/Program1
    /SharedSources
       /Core_branch
          Core.csproj
    /Sources
       /Program1
          Program1.csproj
       /Program2
          Program2.csproj
       Sources.sln

If you had setup your SCM-structure like that, you would just have to define the following in your build definition:
$/Program1 $(SourceDir)

So, if you had an issue on a past version of Program1, you could proceed with a Hotfix branch and not face your current challenge . An excellent resource on general TFS branching & solution shaping in source control can be found here.

On your specific question "How can I change the workspace for only the Core directory to get by the label instead of getting the latest.":
In you own Workstation/Workspace, you could get a past version & then use Cloak to exclude Core from a following GetLatest. This can enable you to conduct analysis, even create shelvesets containing changes within Program1 that fix any bugs.
But, since cloaking isn't usable during build (see here for an interesting post), I believe you are eventually forced to proceed with a branch, in order to get your fixes build.

like image 50
pantelif Avatar answered Nov 24 '25 06:11

pantelif



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!