How to make "Team Build" skip getting certain folders?

I have readManish Agarwal blog regarding this. (http://blogs.msdn.com/manishagarwal/archive/2005/10/13/480584.aspx) But I have another question. Is there a way to exclude everything except the folder I need. This would be far easierfor me to white list the folders required then try to black list all the other folder I do not need.

Thanks

-Matt-

[1101 byte] By [mkruer] at [2008-1-4]
# 1

You just need to change the workspace mappings used by the build: http://blogs.msdn.com/buckh/archive/2007/02/28/schema-for-the-workspacemapping-xml-file.aspx.

Buck

BuckHodges at 2007-9-26 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 2

That somewhat answers one of my questions. But I ran into a snag getting multiple folders for different projects.

Within the WorkSpaceMappings.xml, if i have it listed as such.

<?xml version="1.0" encoding="utf-8"?>

<SerializedWorkspace xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<Mappings>

<InternalMapping ServerItem="$/Development_Code/Client/Project1" LocalItem="F:\Build_Management\TFSWeb1\Development_Code\Client\Project1" Type="Map" />

</Mappings>

</SerializedWorkspace>

It drops the Source files into the root of the Folder.

but if I add a second Folder to include

<?xml version="1.0" encoding="utf-8"?>

<SerializedWorkspace xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<Mappings>

<InternalMapping ServerItem="$/Development_Code/Client/Project1" LocalItem="F:\Build_Management\TFSWeb1\Development_Code\Client\Project1" Type="Map" />

<InternalMapping ServerItem="$/Development_Code/Deployment/BuildProject1" LocalItem="F:\Build_Management\TFSWeb1\Development_Code\Deployment\BuildProject1" Type="Map" />

</Mappings>

</SerializedWorkspace>

It Suddenly changes to the Root + /Client/Project1 and Root + /Deployment/BuildProject1 when they should both just be in the root. Is there a way to override this behavor?

mkruer at 2007-9-26 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 3

You may need to override the AfterGet target to achieve this. Something like this should work:

<Target Name="AfterGet">

<CreateItem Include="$(SolutionRoot)\Project1\**\*.*">

<Output ItemName="Project1Files" TaskParameter="Include" />

</CreateItem>

<CreateItem Include="$(SolutionRoot)\BuildProject1\**\*.*">

<Output ItemName="BuildProject1Files" TaskParameter="Include" />

</CreateItem>

<Move SourceFiles="@(Project1Files)" DestinationFiles="@(Project1Files->'$(SolutionRoot)\%(RecursiveDir)%(FileName)%(Extension)')" />

<Move SourceFiles="@(BuildProject1Files)" DestinationFiles="@(BuildProject1Files->'$(SolutionRoot)\%(RecursiveDir)%(FileName)%(Extension)')" />

<RemoveDir Directories="$(SolutionRoot)\Project1;$(SolutionRoot)\BuildProject1" />

</Target>

WilliamBartholomew at 2007-9-26 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 4

There is not a way to override this behavior in V1 - you'll need to do something like William's suggestion if you need this sort of directory structure. Watch out for relative paths, however - if your development box workspace mappings do not put these files into the same directory, any references between the two may end up broken.

Also note that in Orcas you will be able to specify a full-fledged workspace, rather than dealing with the pseudo-workspace from v1 (where LocalItems are ignored, etc.).

-Aaron

AaronHallberg-MSFT at 2007-9-26 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...

Visual Studio Team System

Site Classified