Answered by:
Getting from Multiple Team Project

Question
-
Hi
I have a Team Project which contains a .sln file. This .sln file contains a class project which is in another team project. When developing we get latest from both the team projects, but how to i do a get latest for automate build process
Thanks
YusufWednesday, March 14, 2007 4:17 PM
Answers
-
Team Build will do a Get Latest of the sources as part of the build process. The assembly you reference in the other team project -- is it checked in to source control or does it get built? Please make sure to take a look at the following post on setting references to assemblies in other team projects:
http://blogs.msdn.com/manishagarwal/archive/2005/12/22/506635.aspx
Hope that helps,
Swaha
Wednesday, March 14, 2007 6:25 PM
All replies
-
Team Build will do a Get Latest of the sources as part of the build process. The assembly you reference in the other team project -- is it checked in to source control or does it get built? Please make sure to take a look at the following post on setting references to assemblies in other team projects:
http://blogs.msdn.com/manishagarwal/archive/2005/12/22/506635.aspx
Hope that helps,
Swaha
Wednesday, March 14, 2007 6:25 PM -
Hi Swaha
Thanks for the reply
Its not the assembly which is in another team project but it is another project by itself which is required to be downloaded and compiled
Let me give you an example
Lets assume TP1 and TP2 as 2 team projects
TP1 contains the .sln file and 3 other class project
TP2 contains a class project which is referenced in .sln file in TP1.
There is only 1 solution file here.
The problem is that I cannot download the class project from TP2. I have to do something additional but I am not sure what.
If you have any solution to this please let me know.
Thanks
YusufThursday, March 15, 2007 3:27 PM -
The blog post Swaha referenced should help get you started - it illustrates exactly the problem you are looking to solve.
-Aaron
Friday, March 16, 2007 8:46 PMModerator -
Hello Yusuf,
We faced the same problem and the post Swaha mentioned was instrumental to our solution.
The approach we took is to let team build define the workspace it usally define by default (in the InitializeWorkspace target) and to add to that workspace any extra mapping (from any team project) by overriding the BeforeGet target
Here is the code you need to put in your buildType.proj:<!-- HZJ: Work around to get source from multiple team projects.-->
<!-- START --><!-- define team projects to include in workspace-->
<ItemGroup>
<Map Include="$/Some/Other/TeamProject">
<LocalFolder>$(SolutionRoot)\Some\Folder</LocalFolder>
</Map>
</ItemGroup><!-- Now map extra team project defined in 'Map' item group in the workspace -->
<Target Name="BeforeGet"><!-- task will add the folder mappings corresponding to items define in map item group -->
<Exec
WorkingDirectory="$(SolutionRoot)"
Command=""$(TfCommand)" workfold /map /workspace:$(WorkSpaceName) /server:$(TeamFoundationServerUrl) "%(Map.Identity)" "%(Map.LocalFolder)""/>
</Target><!-- END -->
You still need to define the tfCommand in the pre-exisiting PropertyGroup like so:<PropertyGroup>
<!-- HZJ: TF COMMAND
define tf command used in target BeforeGet
-->
<TfCommand>$(TeamBuildRefPath)\..\tf.exe</TfCommand>
<!-- TEAM PROJECT
The team project which will be built using this build type.
-->
<TeamProject>TeamProject</TeamProject>
....Tuesday, March 20, 2007 11:47 AM -
Hi Hisham
I did do this. I am able to "get" the files, but when it comes to compile the project, the solution complains that the project is not in the same team project so it cannot compile.
So I am still on square one.
If you have any other ideas then please let me know
Thanks
YusufTuesday, March 20, 2007 4:00 PM -
Can you post the error messages from your build log? Compilation shouldn't care (or even know) about team projects.
-Aaron
Tuesday, March 20, 2007 5:14 PMModerator -
Hello Yusuf,
This shouldn't happen. Try to build the solution manually on the build machine, using the workspace that was fetched from TFS by Team Build. I believe you will see the same error, which you should be able to rectify and do the necessary changes to the build script. If the solution builds fine, then there is something fishy happening, and more information is needed to figure it out....
Thursday, March 22, 2007 5:25 AM