how to select custom name in ConvertWorkspaceItem in TSF 2010 - tfs

I have a project that has two folders , Main , archive . Main is mapped by Team Build for building ( which I could reach to by SourcesDirectory). This is mapped in build definition as "sources"
Then I have manually mapped "$/" to a different location which include Main and archive.
When I see in " Manage workspaces" I see two workspaces (1) which maps Main and (2) which maps complete project.
Now when I use activity ConvertWorkspaceItem as
direction = server to local
input "$/"
result some variable
workspace workspace
and builds it fails with "$/project is not mapped" as by default workspace being referenced is the one which maps to $(sources).
is there a way I can modify ConvertWorkspaceItem to select user defied workspace ? or any other way I could get to $/project other then hard coding the path ?

Related

TFS Build Drop Folder

I'm currently working on a custom build process and have a problem with the understanding of drop folder. The process creates only some reports which we need for further development. We are using TFS/VS 2012.
What I actually need is either a folder on the buildserver where the Reports are going to be saved and accesable from everyone or on each team members local machine a drop folder. In my opinion the first solution should be better but is it possible, since I'm the only one out of my team which has Access to the buildserver.
If I select the UNC path to the drop folder on the buildserver can other People without Access to this Server use the "Open Drop Folder" button? And how do I even copy files to the drop folder? Is it enough to just do CopyDirectory? In the moment it always says: "This build did not produce any Outputs. The drop Location field is empty..."
I would be really glad if someone could help me.
The purpose of the drop folder is to copy the result of the build from the working folder of the agent and somewhere where it will not be changed by a later build. The share can be on the build server or on another server. No matter what you need to control the permissions to that folder so that whomever needs access has it. Otherwise the Open Drop Folder button will not work.
You can enable so that the build results are copied to the drop location upon build completion. This is a bit different whether you use Build vNext or XAML build. Since you are using TFS 2012, I guess that you are using XAML builds. Drop location is specified under the Build Defaults tab of the build definition.
The output folder from your build will be copied so assemblies, test results etc. will be copied to the drop location when enabled. If there is something extra that you want to be included in your drop, then copy it to the output folder or create it there directly.

I made a mistake in my source control mapping. How do I correct it?

I created a team project, say ProjectA
When I mapped it to my local folder, I found that the root server folder: ProjectA folder is not mapped. However the ProjectA folder within that IS mapped to the project. This is a problem as the BuildProcessTemplate is not included in source control and I cannot build my application.
How do I remove the mappings and start again?
On the source control explorer window in visual studio there is a drop down near the top for workspaces. When you originally mapped that folder, it created a workspace for you. If you want to change the mappings, it can be done by clicking the drop down and selecting the Workspaces... option. You can select your workspace and then click Edit.. to change mappings. You can also delete your current workspace and create a new one if you feel so inclined.

Working with TFS source control folders without map to local folder

I have many projects in my Source Control folder, can I work from the server repository without mapping a local folder?
No, but you can configure you local workspace to only map to the folders you are interested in. You can also create more that one workspace.
For example:
Create workspace called "Project A"
Create a Mapping from $/TeamProject/Stuff/MoreStuff/ProjectA to C:\Code\ProjectA
Repeat for other projects you are interested in.
You can now select a workspace to use in Source Control Explorer (and in Pending Changes). When you do a "Get Latest" on your workspace you will only get files you have mapped.

TFS 2010 checkin with tf.exe command-line

I have several projects in my TFS collection and I want to perform checkin during build of one of the project. I have build template and I'd like to use tf.exe with InvokeProcess activity. But how can I specify source files and destination project folder in command-line arguments of tf.exe? Or I need copy files manually to destination project folder?
You should be able to set the WorkingDirectory property of the InvokeProcess Activity to the folder where your Workspace on the server is. You may need to the ConvertWorkspaceItem(s) Activity to convert it to a physical path on the server (i.e. C:\Code from $/Server/Code). If you've not done this before, you may need to create a Sequence activity to perform the 2 steps; you can then store the output of ConvertWorkspaceItem in a variable scoped to the Sequence, and use it as the WorkingDirectory of the InvokeProcess.

Proper build reports in TFS with multiple products under a project

Underneath one "Project" in TFS we have multiple products. This is because for us, a project is a business unit and they each can have many applications that we develop for them. Each one has its own folder in source control(under the TFS project) and each one has its own TeamBuild set up. The issue I have is that whenever a build runs, the report generated for it contains a listing of all the changesets that were associated to the TFS Project; even though many of them were for a different product and the code referenced actually wasn't compiled or built during that build.
Does anyone know how to get TFS to only include changesets in its report that are associated to the actual VisualStudio projects that are being built in TeamBuild?
The best solution would to to modify the Workspace Mapping for the Team Build Definition to include the Solution Root path instead of the Team Project Root.
In TFS2008,
Right click the Team Build Definition and choose 'Edit Build Definition'
Select the 'Workspace' tab
Remove the existing mapping: $/TeamProjectName
Add a new mapping to the solution root, for example: $/TeamProject/Main/Solution1/
In TFS2005,
Open Source Control Explorer
Browse to $/TeamProject/TeamBuildTypes/BuildName/WorkspaceMappings.xml
Get Latest of the file and check it out for edit
Remove the existing mapping: $/TeamProjectName
Add a new mapping to the solution root, for example: $/TeamProject/Main/Solution1/
This workspace mapping defines the scope for changesets to be included in the build.
See:
http://blogs.msdn.com/buckh/archive/2007/08/14/tfs-2008-a-basic-guide-to-team-build-2008.aspx
http://msdn.microsoft.com/en-us/library/ms181718.aspx
http://msdn.microsoft.com/en-us/library/ms181286.aspx
Grant

Resources