TFS 2010构建自动化和构建后活动 [英] TFS 2010 Build Automation and post-build event

查看:76
本文介绍了TFS 2010构建自动化和构建后活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我继承的项目中,原始开发人员在Visual Studio项目中使用了许多构建后事件来在VS中进行构建时在DLL和其他内容周围进行复制.

In the project I've inherited, the original developer used a number of post-build events in his Visual Studio projects to copy around DLL's and stuff when building inside VS.

现在,由于我正在尝试将这些内容移至TFS 2010 Build系统,这引起了一定的悲伤.

This is causing some grief now that I'm trying to move these things to the TFS 2010 Build system.

我希望能够创建一个新的"Continuous"项目配置,并从该配置中排除Visual Studio中的那些生成后事件-但看来这些调用无法根据您的项目配置进行配置...

I was hoping to be able to create a new "Continuous" project configuration, and exclude those post-build events from Visual Studio in that configuration - but it seems those calls aren't configurable based on your project configuration....

有什么想法吗?是否可以检查一下以确保我在TFS Build下运行,然后仅跳过那些CMD文件?任何想法都将受到欢迎!

Any ideas? Is there something I could check for to know I'm running under TFS Build and then just skip those CMD files? Any ideas would be most welcome!

推荐答案

如果您在团队构建服务器上设置环境变量,然后可以在构建后的步骤中编写检查以检查该环境变量,该怎么办?如果设置了环境变量,那么您将跳过执行构建后步骤的命令文件,因为您知道自己正在TFS构建下运行.

What if you set an environment variable on your team build server, and then you could write a check into your post build steps to check for that environment variable. If the environment variable is set, you'd know to skip the command files that do the post build steps because you'd know you are running under TFS build.

您可以将所有后期构建步骤组合到一个脚本中,然后只需检查该脚本开头的环境变量即可.

You could combine all your post build steps into one script possibly, and then just check the environment variable at the beginning of that script.

或者您可以采用相反的方法,并将支票构建到TFS构建脚本中.您可以参考此处,了解如何检查TFS版本中的环境变量

Or you may be able to do it the opposite way and build the check into your TFS build script. You can refer here for how to check an environment variable in a TFS build.

因此,在您的TFS构建脚本中,您将具有以下内容:

So in your TFS build script you'd have something like:

<RunScripts Condition=" '$(RunScriptsServerVar)' != '' ">
            the environment var is NOT set, so run your scripts since we aren't in
            a TFS build
</RunScripts>

这篇关于TFS 2010构建自动化和构建后活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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