Ask a questionAsk a question
 

AnswerTFS Version Control Tasks

  • Wednesday, June 07, 2006 4:40 AMChrisKinsmanMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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

  • Wednesday, June 07, 2006 2:07 PMAaron HallbergMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    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

  • Wednesday, June 07, 2006 2:07 PMAaron HallbergMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    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

  • Thursday, June 08, 2006 8:30 PMcashfoley Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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.

  • Monday, June 12, 2006 2:35 AMSteve St.Jean Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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.

     

  • Wednesday, February 20, 2008 11:51 AMMatt Thompson Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     

    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

  • Wednesday, February 20, 2008 4:04 PMAaron HallbergMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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

  • Wednesday, March 12, 2008 3:44 PMAlexKing Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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:&quot;Auto Update on BRE Compile&quot; /noprompt /override:&quot;Auto Update on BRE Compile&quot; /recursive myDll.dll"/>

    fails (exits with error code 100)

     

    I get crazy trying to work this out

    Thx for your help, if any

  • Wednesday, March 12, 2008 9:00 PMcedric_y Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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)

  • Tuesday, July 22, 2008 3:54 PMspatos Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    How you obtain the $(WorkspaceName) and $(WorkspaceOwner) values inside the task?.

    Thanks in advance

  • Wednesday, July 23, 2008 1:12 PMAaron HallbergMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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

  • Friday, July 25, 2008 8:31 AMMike Fourie Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    TFS version control tasks are available here: http://www.codeplex.com/freetodevtasks

    There is currently support for

    Add

    Checkin

    Checkout

    Delete

    Get

    UndoCheckout

    Undelete