locked
Team Build only allows one Team Project per workspace - why? RRS feed

  • Question

  • We have one Team Project for our core framework code, and individual team projects for the various applications that use this framework.

    Trying to use Team Build to compile these solutions results in file not found errors as Team Build doesn't bother retrieving the code files from the other Team Project.

    So instead I just change the WorkspaceMapping.xml to include the shared Team Project. Sadly, this fails too. It seems that the CreateWorkspaceTask that gets called in the CoreGet target explicitly checks that the new workspace only references one Team Project.

    Can anyone from Microsoft explain why this is and suggest any sensible options to get around this?

    Also, is there any documentation on the TeamBuild tasks? It doesn't feel right having to use ildasm just to see what properties and tasks are available!
    Wednesday, September 28, 2005 11:14 AM

Answers

  • Hi Michael

    Please have a look at the following blog post made my Manish explaining how this can be done. http://blogs.msdn.com/manishagarwal/archive/2005/09/26/473943.aspx 

    As for the documentation on Team Build tasks - sorry we do not have them in beta3 but thanks for the feedback - we will definitely try and include this in the future release.

    Thanks,
    -Khushboo
    Wednesday, September 28, 2005 12:57 PM

All replies

  • Hi Michael

    Please have a look at the following blog post made my Manish explaining how this can be done. http://blogs.msdn.com/manishagarwal/archive/2005/09/26/473943.aspx 

    As for the documentation on Team Build tasks - sorry we do not have them in beta3 but thanks for the feedback - we will definitely try and include this in the future release.

    Thanks,
    -Khushboo
    Wednesday, September 28, 2005 12:57 PM
  • Khushboo, many thanks for pointing me to Manish's blog - it was very helpful.

    Sadly, however, the example in the blog didn't work for me.

    Instead MSBuild would throw a Logger exception when trying to determine the workspace of the additional projects. It didn't help that Team Build didn't log these exceptions, it merely truncated the log at the point of failure.

    However, I did manage to get it all to work doing things slightly differently.

    For those who are interested, here's my solution:

    <PropertyGroup>
    <WorkingDirectories>$(SolutionRoot)\..\Reusable Code</WorkingDirectories>
    </PropertyGroup>

    <PropertyGroup>
    <TfCommand>&quot;$(TeamBuildRefPath)\..\tf.exe&quot;</TfCommand>
    </PropertyGroup>

    <Target Name="AfterGet">
    <!-- Clean and create the working folder for the external project -->
    <RemoveDir Directories="$(WorkingDirectories)" ContinueOnError="true" />
    <MakeDir Directories="$(WorkingDirectories)" />

    <!-- Delete existing workspace created by TeamBuild -->
    <Exec Command="$(TfCommand) workspace /delete &quot;$(WorkSpaceName)&quot; /server:vsts /noprompt" WorkingDirectory="$(SolutionRoot)\..\Reusable Code" ContinueOnError="true" />

    <!-- Create a new one with the same name as the TeamBuild one -->
    <Exec Command="$(TfCommand) workspace /new &quot;$(WorkSpaceName)&quot; /server:vsts /noprompt" WorkingDirectory="$(SolutionRoot)\..\Reusable Code" />

    <!-- Map the external projects to this workspace -->
    <Exec Command="$(TfCommand) workfold /map /workspace:&quot;$(WorkSpaceName)&quot; /server:vsts &quot;$/Reusable Code/Framework&quot; &quot;$(SolutionRoot)\..\Reusable Code\Framework&quot;" WorkingDirectory="$(SolutionRoot)\..\Reusable Code" />

    <!-- Get the external projects into the correct locations -->
    <Exec Command="$(TfCommand) get &quot;$/Reusable Code/Framework&quot; /recursive /version:T /force" WorkingDirectory="$(SolutionRoot)\..\Reusable Code" />

    <!-- Label external projects -->
    <Exec Condition=" '$(SkipLabel)'!='true' " Command="$(TfCommand) label /server:vsts &quot;$(BuildNumber)&quot; &quot;$/Reusable Code/Framework&quot; /version:&quot;W$(WorkSpaceName)&quot; /recursive" WorkingDirectory="$(SolutionRoot)\..\Reusable Code" />

    <!-- Add mapping to default project back into the workspace -->
    <Exec Command="$(TfCommand) workfold /map /workspace:&quot;$(WorkSpaceName)&quot; /server:vsts &quot;$/CodeGeneration&quot; &quot;$(SolutionRoot)&quot;" WorkingDirectory="$(SolutionRoot)" />
    </target>
    Thursday, September 29, 2005 9:08 AM