By default, when a queued build is running, MSBuild calls the CoreLabel task to label the source files that were included in the build - how do I control where this label is created?
Basically, I would like the label to be created at the root of the Team Project (i.e. folder "Client" below), however it appears that the label is created at the root of the working folder for the workspaces (i.e. Project 1\Development\Sources):
$ <-- Project Collection
+- Client <-- Team Project
+- Project 1 <-- Project
+- Deployments <-- Assets for a deployment
+- 1.0.0.0
+- 1.1.0.0
+- Development <-- Development Branch
+- Source <-- Dev Build Definition working folder mapped here.
+- Environment <-- Scripts, etc. for deployments.
+- Main <-- Main Branch
+- Source <-- Release Build Definition working folder mapped here.
Within the build definitions, we have specified a "Working folder" in the workspace at the "Source" folder level for either Development or Main depending on the build type.
Looking at the build logs, it looks like the label should be created at the Client level:
Task "Label" (TaskId:42)
Label TeamFoundationServerUrl="http://TFSServer:8080/tfs/DefaultCollection"
BuildUri="vstfs:///Build/Build/4538"
Name="Nightly_20110303.5"
Scope="$/Client"
Recursive=True
Comments="Version-1.0.0.0 Requested-xxx Get-T Branch-Development"
Version="WCATQCDEV-BLD_35_8"
Child="Replace"
Files="$/" (TaskId:42)
Label Nightly_20110303.5@$/Client (version WCATQCDEV-BLD_35_8) was successfully created. (TaskId:42)
However, even though Files
is set to $/
the label is still created at the working folder level. According to the documentation, the Files
parameter is supposed to specify which files are included in the label, but clearly it's not working quite as we'd like.
I've successfully modified the comment that is created using the BeforeLabel
task setting the LabelComment
property, however, trying to set the LabelFiles
property in the same task to something like $/Client
doesn't seem to affect the location the Label is created at, and also seems to end up mangled to %26/Client
in the log when it calls the Label method.