我一直在使用谷歌搜索,并找不到任何可靠的例子如何完成,或者如果它甚至可以完成。我认为它可以。任何人都可以将我指向正确的方向吗?是否可以使用TFS SDK创建,排队和跟踪构建?
到目前为止,我一直在寻找关于msdn的TFS命名空间文档。我的目标是能够从Intranet Web应用程序完全自动化并跟踪我们在TFS中的构建。
我一直在使用谷歌搜索,并找不到任何可靠的例子如何完成,或者如果它甚至可以完成。我认为它可以。任何人都可以将我指向正确的方向吗?是否可以使用TFS SDK创建,排队和跟踪构建?
到目前为止,我一直在寻找关于msdn的TFS命名空间文档。我的目标是能够从Intranet Web应用程序完全自动化并跟踪我们在TFS中的构建。
理查德向我指出了正确的方向,所以我会用我发现的东西来回答我自己的问题。
是的,您可以使用TFS SDK创建,排队和跟踪构建。您想要的接口/类位于Microsoft.TeamFoundation.Build.Client命名空间中。 IBuildServer,IBuildDefinition和IBuildDetail特别有用。
TFS 2010更新:下面是一个使用TFS 2010 SDK的例子程序,发现here:
using System;
using System.Collections.Generic;
using Microsoft.TeamFoundation.Build.Client;
using Microsoft.TeamFoundation.Build.Workflow;
using Microsoft.TeamFoundation.Client;
namespace ManageBuildTemplates
{
class Program
{
static void Main(string[] args)
{
TfsTeamProjectCollection collection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://jpricket-test:8080/tfs/collection0"));
IBuildServer buildServer = collection.GetService<IBuildServer>();
IBuildDefinition definition = buildServer.GetBuildDefinition("UnitTests", "Definition1");
IBuildRequest request = definition.CreateBuildRequest();
request.ProcessParameters = UpdateVerbosity(request.ProcessParameters, BuildVerbosity.Diagnostic);
buildServer.QueueBuild(request);
}
private static string UpdateVerbosity(string processParameters, BuildVerbosity buildVerbosity)
{
IDictionary<String, Object> paramValues = WorkflowHelpers.DeserializeProcessParameters(processParameters);
paramValues[ProcessParameterMetadata.StandardParameterNames.Verbosity] = buildVerbosity;
return WorkflowHelpers.SerializeProcessParameters(paramValues);
}
}
}
查看tfsbuild.exe(位于VS安装的.../Common9/IDE文件夹中)。
此引用组件Microsoft.TeamFoundation.Build.Client
和Microsoft.TeamFoundation.Build.Common
看起来有用,...,且含有不与其他TFS cient assembliies文档的命名空间,但在MSDN这里http://msdn.microsoft.com/en-us/library/cc339575.aspx
谢谢,这导致我的解决方案。 – JimDaniel 2009-03-04 21:02:13