开发者

How to develop custom activities for Team Build 2010 in an efficient way?

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 cu开发者_如何学运维stom 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 ?


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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜