开发者

Check Source code changed since last TFS successful build

In TFS 2010 custom activity how to find out programatically whether my project(s) source code changed / checked in since its last successful开发者_Go百科 build.


You can use the build and version control APIs to achieve this.

First, you need to figure out the last successful build label by looking at the LastGoodBuildLabel property of your build definition.

Use this label as the versionFrom argument of the QueryHistory method and the Latest version spec as the versionTo, you can check to see if there is any History entry exists between there and now.

You need to specify the path as the root of your source code, set recursive to true, and other extra information flags to false. You might also want to set the maximum count of History entries to be 1 because all you need to know is whether it exists.

Hope it helps.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜