如何高效地为 Team Build 2010 开发自定义活动?

发布于 2024-11-02 06:23:58 字数 358 浏览 9 评论 0原文

要为 Team Build 2010 创建自定义工作流活动,我必须创建一个包含我的自定义活动的类库,以及另一个用于自定义构建过程(工作流)的类库。

我的开发工作流程是:

  • 为自定义活动编写代码
  • 构建自定义活动
  • 从源代码管理
  • 签入中删除自定义活动程序集以有效删除源代码管理中的文件
  • 在源代码管理签入中添加新版本的程序
  • 集以有效添加在源代码管理中进行组装
  • ,最后进行测试,更新了构建定义!

然后,每次我想测试自定义活动的修改时,重复所有这些步骤...

有没有办法以有效的方式执行这些步骤,以获得更好的开发体验?

To create a custom workflow activity for Team Build 2010, I have to create a class library that will contains my custom activities, and another one to customize the build process (the workflow).

My development worklow is :

  • write code for the custom activities
  • build the custom activities
  • delete the custom activities assembly from the source control
  • checkin to effectively delete the file in the source control
  • add the new version of the assembly in the source control
  • checkin to effectively add the assembly in the source control
  • and finally test, the updated build definition !

and then, repeat all theses steps, every time I want to test a modification of my custom activities...

Is there a way to do theses steps in an efficient way in order to get a much better development experience ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑咖 2024-11-09 06:23:58

您可以编写一个批处理文件,该文件从自定义构建程序集位置执行程序集的签出,复制新构建的文件,然后将其重新签入。

以下是此类脚本文件的示例:

cd c:\YourLocalPathForYourCustomBinaries\TFS2010CustomBuildBinaries 
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" checkout /lock:none /recursive *.dll
copy C:\YourBuildOutputLocation\YourBuildOutput.dll c:\YourLocalPathForYourCustomBinaries\YourBuildOutput.dll
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" checkin 

请注意第一行。这需要是本地计算机上已经有工作文件夹映射的文件夹,否则您需要修改脚本以包括工作区创建等。如果您已经在 TFS 中映射了此文件夹,它将自动解析。

然后,您可以在需要时通过 Visual Studio 的命令窗口运行此脚本使用 shell 命令在构建上下文中进行测试:

shell /c c:\YourScriptLocation\YourBatchFileName.cmd

您甚至可以运行您的构建后事件上的脚本,这将确保每次构建程序集时都会将其检入您的自定义构建程序集位置。

You could write a batch file which executes the checkout of the assembly from the custom build assemblies location, copies the newly built file, and checks it back in.

Here is an example of such a script file:

cd c:\YourLocalPathForYourCustomBinaries\TFS2010CustomBuildBinaries 
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" checkout /lock:none /recursive *.dll
copy C:\YourBuildOutputLocation\YourBuildOutput.dll c:\YourLocalPathForYourCustomBinaries\YourBuildOutput.dll
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" checkin 

Notice the "Change Directory" on the first line. This needs to be a folder on your local machine to which you already have a working folder mapping, otherwise you'll need to ammend the script to include workspace creation etc. If you already have this folder mapped in TFS, it will get resolved automatically.

You can then run this script through Visual Studio's command window when you want to test in a build context using the shell command:

shell /c c:\YourScriptLocation\YourBatchFileName.cmd

You could even run your script on the post-build event which will ensure that every time you build your assembly it will get checked into your Custom Build Assemblies location.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文