First of the screenshot of my Build Definition Configure screen:
TemplatePath is defined as string in my build definition file.
I have a custom Build Activity class that has a property:
public class MyActivity: NativeActivity {
public InArgurment<string> TemplatePath{ get; set;}
public void Execute(NativeActivityContext context){
//My Code goes here
}
}
What I want to do is to be able to pass in the value of the TF_BUILD_SOURCESDIRECTORY
environment variable into TemplatePath
.
Let's say the sources directory maybe C:\Build[BuildAgentId][TFS_Project][Build Definition]\src, I want to be able to receive this information when I use the following code in my Execute method.
string templateLoc = TemplatePath.Get(context);
The screenshot has one of the values that I've been trying pass in. No matter which value I tried to pass in, I still receive the exact string from the TemplatePath
set in the build definition configuration. How do I make TFS Build evaluate the expression to provide me with the correct path: C:\Build[BuildAgentId][TFS_Project][Build Definition]\src\Template\Template.qvw
I've been searching and playing around with different ways to passing the TFS BUILD environment variables but was not able to figure out/find a solution to do so. I may have been searching for the wrong thing.
Thank you,