I have a build template with variables created and the values are set in the build template itself.
I开发者_如何学Python have another custom activity in the same build template. My custom activity will read an XML file which has the names of all variables created.
My query here is, how to read the value of the build variables created in the build process template?
Any help?
Here is how you read a variable specified in the build template into your custom activity:
Assume you have the following variable in your build template:
<x:Property Name="BuildNumberFormat"> Type="InArgument(x:String)" />
Define an InArgument property in your custom activity class. For example:
public InArgument<String> MyBuildNumberFormat { get; set; }
In the custom activity declaration in the build template, set your property to the build variable as followed:
<mtbwa:UpdateBuildNumber MyBuildNumberFormat="[BuildNumberFormat]" DisplayName="Update Build Number" />
Hope this helps.
精彩评论