TFS Version Control Tasks
Microsoft.TeamFoundation.Build.Tasks.VersionControl.dll contains a get MSBuild task but no tasks for CheckIn or CheckOut. Are we relegated to calling the command line versions? Pretty lame if so...
Answers
You are correct that there is no custom task for checking in or checking out files. Out of curiosity - why would you want to do this during the build process?
-Aaron
All Replies
You are correct that there is no custom task for checking in or checking out files. Out of curiosity - why would you want to do this during the build process?
-Aaron
While I'm not the initial poster I can speak for why I need these tasks.
To utilize TFS as a Publication point build results. These can be libraries are used in multiple dependent Solutions. Other situations, we have automated build processes to build XML files that are used in build processes. I want these files versioned and managed in Source Control not on shared drive spaces.
Also not the original poster, but my team uses a Team Build for continuous integration. We also use code generation (lots!). To make sure we are building and testing the code from the code generation templates, we checkout, codegen, checkin, relabel and compile our projects. This allows us to promote a version of code to the Enterprise build that doesn't require code generation at that level as they can Get by label.
We use are large amount of code generation, so ensuring that all generated code, across the entire project (many assemblies) are updated when a template changes is very important to us. Since there are so many to manage, it is possible for a developer to forget to regen a file after a template change. This solves that problem.
I have written a custom task which fires a console app that does the checkout, codegen, checkin and label for us during our builds.
Did anyone get any where with this?
I'm looking at using the command line tools during the build, but i will need to do something about the workspace as the build one does not appear to be valid for these source control operations...
Matt
If the files you need to checkout/checkin are mapped by the workspace mappings for the build, the workspace the build creates should work just fine when using <Exec> to call tf.exe - just make sure that the working directory is set to a mapped directory (e.g. $(SolutionRoot)).
-Aaron
I actually have this necessity
I have several solutions under one TFS project. One solution is pure C# projects and one of the outputs is a dll on which i make a reference in a second solution that is BizTalk & C# project. To avoid version conflict upon deploying the BizTalk solution, I would like to Update the dll (that is placed in an external assembly folder on which the reference is made) in source control. So I have to check it out, replace it an check it in back again. The probleme I face is that i can't do so, even using the TF.exe tool with the exec command of team build.
First of all i am unable to replace the "old" dll with the newly compiled one in the after compile target
This
<
Copy SourceFiles="$(OutDir)\myDll.dll" DestinationFolder="$(SolutionRoot)\myPath\ExternalAssemblies" ContinueOnError="true" />fails because "access is denied" (then delete command as well)
<
Exec WorkingDirectory="$(SolutionRoot)\mypath\ExternalAssemblies" Command="$(TF) delete /comment:"Auto Update on BRE Compile" /noprompt /override:"Auto Update on BRE Compile" /recursive myDll.dll"/>fails (exits with error code 100)
I get crazy trying to work this out
Thx for your help, if any
We created a custom tfs build task to do our checkout/checkin. After the upgrade to TFS 08, I found a workspace issue where it couldn't identify the workspace via a local directory, don't know why. We now explicitly retrieve the workspace by its name using the workspace name property.
The workspace name build property is $(WorkspaceName). Also the owner is $(WorkspaceOwner)
How you obtain the $(WorkspaceName) and $(WorkspaceOwner) values inside the task?.
Thanks in advance
The standard approach would be to have WorkspaceName and WorkspaceOwner properties on the task and then pass these values in when it is invoked. Something like:
<MyTask WorkspaceName="$(WorkspaceName)" WorkspaceOwner="$(WorkspaceOwner)" ... />
-Aaron
- TFS version control tasks are available here: http://www.codeplex.com/freetodevtasks
There is currently support for
Add
Checkin
Checkout
Delete
Get
UndoCheckout
Undelete

