XAML构建定义 - Git的构建变量“Checkout Override”参数? [英] XAML Build definition- build variable for Git "Checkout Override" parameter?

查看:72
本文介绍了XAML构建定义 - Git的构建变量“Checkout Override”参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello -


在基于Git repo的项目的XAML构建定义中,我想要以编程方式访问"Checkout Override"。参数,以便我可以让构建脚本根据指定的分支将安装工具包复制到不同的目录。 
(例如"origin / my_branch" 我会在"/"上进行搜索和替换当然...


是否有程序化访问权限在XAML构建定义中这是什么?


我看到vNext构建定义,根据  https:// www,它是  BUILD_SOURCEBRANCHNAME。 visualstudio.com/en-us/docs/build/define/variables


有没有办法让它为XAML构建?


非常感谢!






解决方案

嗨Andrew Lindeman,


谢谢你在这里发布。


对于vNext构建中的BUILD_SOURCEBRANCHNAME,它是一个预定义变量,但在XAML构建中,在构建环境变量中未定义"Checkout Override"项。请参阅
< a href ="https://msdn.microsoft.com/en-us/library/hh850448(v=vs.120).aspx"> Team Foundation构建环境变量以获取详细信息。


因此,如果你想将它用作变量,你必须声明一个变量并映射到参数的值,请参考

此主题
获取更多信息。


此外,您可以尝试使用TFS API获取参数值,请参考以下文章:

TFS API:以编程方式访问构建定义值


最好的问候。


Hello-

On a XAML Build Definition for a Git repo based project, I'm wanting programmatic access to the "Checkout Override" parameter so that I can have the build script copy the install kit to a different directory based on the branch specified.  (for example "origin/my_branch"  I will do a search and replace on the "/" of course...

Is there programmatic access to this in the XAML build definition?

I see for the vNext build definitions, it is BUILD_SOURCEBRANCHNAME according to https://www.visualstudio.com/en-us/docs/build/define/variables

Is there any way to get to it for the XAML builds?

Thanks much!

解决方案

Hi Andrew Lindeman,

Thank you for posting here.

For BUILD_SOURCEBRANCHNAME in vNext build, it’s a Predefined variable, but in XAML build the ‘Checkout Override’ item is not defined in Build environment variables. Please see Team Foundation Build environment variables for details.

So, if you want to use it as a variable you have to declare a variable and map to the value of  the arguments, please reference this thread for more information.

Besides, you can try the TFS API to get values of the parameters, please reference this article: TFS API: Accessing build definition values programmatically

Best Regards.


这篇关于XAML构建定义 - Git的构建变量“Checkout Override”参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆