Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS build definition and relative workspace path

Tags:

msbuild

Assuming this folder structure in the TFS 2010

Main
    Collection_A
        Solution_A1
        Solution_A2
        Reference Assemblies
    Collection_B
        Solution_B1
            Project_B1A

Project_B1A references the dll in Reference Assemblies of Collection_A by using relative path (..\..\..\Collection_A\Reference Assemblies\Whatever.dll). When defining the build definition in TFS, we are having trouble in the the Workflow tab.

Project_B1A => $(SourceDir)

for Reference Assemblies it should be

Reference Assemblies => $(SourceDir)\..\..\..\Collection_A\Reference Assemblies

but then TFS throws error

TF215083: The local path $(SourceDir)\..\..\Collection_A\Reference Assemblies for a 
workspace mapping is not valid. (Detail Message: TF10202: The path '..' ends with a 
character which is not allowed. Characters which are not allowed include '.' and ' '.)

We have tried $(SourceDir)\Collection_A\Reference Assemblies and $(BuildDir)\Collection_A\Reference Assemblies but as expected none worked. Are there any other variable that could be used?

like image 903
amit_g Avatar asked Jan 04 '12 02:01

amit_g


1 Answers

As the error message indicates, I don't think using relative path is allowed when defining the working folder mappings.

What you should do instead is to start the mapping from the most common path of all possible paths you want to map (in this case, it's Main). So $(SourceDir) should be mapped to Main. However, you should map only the top level of Main (by using the asterisk as Main/*). This means you don't want to map Main recursively. Then you specify the specific sub folders of Main in other mappings.

It would look something like:

$/Main/* -> $(SourceDir)
$/Main/Collection_A/Reference Assemblies -> $(SourceDir)\Collection_A\Reference Assemblies
$/Main/Collection_B/Solution_B1/Project_B1A -> $(SourceDir)Collection_B\Solution_B1\Project_B1A

Alternatively, if the number of paths you don't want to map is less than the number of paths you want to map under a root path, you can map the root path recursively, but selectively cloak the ones you don't need.

Hope this helps.

like image 92
Duat Le Avatar answered Oct 21 '22 07:10

Duat Le