We are currently setting up Team Build 2010 for our company, and I am trying to use workflow activities to retrieve the exact local path to the current solution being built. I haven't found a way to get this value, does anybody know how (without writing a custom activity)?
Either one of server or local path would suffice (i.e $/TeamProject/Branch/OurProject
or C:\TeamBuild\src\path\to\branch\OurProject
) since we can use the conversion activities on the server item.
The reason we need this path is for updating version info files, and that needs to be done for only the current solution being built, and the files have the same names (AssemblyInfo.cs, for example).
In this similar question, the solution is to define a parameter, but since this information is particular to the solution being built and not some external path, we were hoping that this info would retrievable.
You can retrieve this particular info without adding anything. If you navigate within your Build Process Template to the position where MSBuild breaks out, you will see that the solution that shall be build is set as a string named
localProject
.This will contain the local path where TFS has downloaded your SLN, something like
C:\TeamBuild\src\path\to\branch\OurProject\OurProject.sln
.Open the XAML and navigate to:
if you select
Run MSBuild for Project
& hitF4
you see it.In order to retrieve what you are after you can define another string-variable
solutionPath
in your Build Process Template & insert under theRun MSBuild for Project
a newAssign
activity withTo : solutionPath
andValue : Path.GetDirectoryName(localProject)