Setting properties in triggered build

白昼怎懂夜的黑 提交于 2019-12-25 14:13:02

问题


When queuing a new build using VS it is possible to pass in arguments to MSBuild which let's you do thing like skipping some steps of the build or do some things conditionally.

Is it possible to pass in such arguments to a build that's triggered by a checkin or a nightly build?


回答1:


You can check the value of the $(Reason) property in your TfsBuild.proj file.

<Target Name="BuildNumberOverrideTarget" Condition=" '$(Reason)' == 'Schedule' ">
    <MyBuildNumberGenerator TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri="$(BuildUri)">
      <Output TaskParameter="BuildNumber" PropertyName="BuildNumber" />
    </MyBuildNumberGenerator>
</Target>

More details available here: http://msdn.microsoft.com/en-us/library/cc716772(VS.90).aspx



来源:https://stackoverflow.com/questions/3786665/setting-properties-in-triggered-build

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!