开发者

Reading build variable using Custom code activty

开发者 https://www.devze.com 2023-03-07 10:18 出处:网络
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 wi

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消