locked
Can I create a label using MSBuild types? RRS feed

  • Question

  • Can I create a label on team system source control before the build process using MSBuild? (I am using VSTS Beta 2).

    Friday, September 23, 2005 6:30 PM

Answers

  • <Target Name="LabelBuild">
      <Exec Command="tf label Build050923 Trunk /recursive" />
    </Target>

    Note that this is using the yet to be released Beta 3 bits where h.exe has been renamed to tf.exe.
    Friday, September 23, 2005 10:15 PM
  • Yes you can. There is a built-in MSBuild task which can create a label.

    You would need to use Microsoft.VisualStudio.Hatteras.MSBuild.dll if you are using Beta2 bits or Microsoft.TeamFoundation.Build.Tasks.VersionControl.dll for Beta3 bits.

    Your MSBuild proj file would have something like this:

        <Label

          Files ="$(FileName)"

          Workspace ="$(WorkspaceName)"

          Name = "$(LabelName)"

          Recursive ="true"/>

     

    If you want this to be part of the Build process you have to customize TeamBuild.proj (beta2) or TFSBuild.proj(beta3).

    Monday, September 26, 2005 9:14 AM

All replies

  • <Target Name="LabelBuild">
      <Exec Command="tf label Build050923 Trunk /recursive" />
    </Target>

    Note that this is using the yet to be released Beta 3 bits where h.exe has been renamed to tf.exe.
    Friday, September 23, 2005 10:15 PM
  • Yes you can. There is a built-in MSBuild task which can create a label.

    You would need to use Microsoft.VisualStudio.Hatteras.MSBuild.dll if you are using Beta2 bits or Microsoft.TeamFoundation.Build.Tasks.VersionControl.dll for Beta3 bits.

    Your MSBuild proj file would have something like this:

        <Label

          Files ="$(FileName)"

          Workspace ="$(WorkspaceName)"

          Name = "$(LabelName)"

          Recursive ="true"/>

     

    If you want this to be part of the Build process you have to customize TeamBuild.proj (beta2) or TFSBuild.proj(beta3).

    Monday, September 26, 2005 9:14 AM
  • Thanks lot for info. 
    I also noticed that team system automatically creates labels corresponding to the build id. 
    Monday, September 26, 2005 3:10 PM