使用 C# 创建 VSTS 构建扩展的示例
Example creating a VSTS build extension using c#
我想在 C# 中组合一些 VSTS 构建/发布管理扩展,虽然我可以找到一些使用 PowerShell 的通用示例,但在 C# 中有一些示例会很方便。
任何人都可以指点我 C# VSTS 扩展示例吗?
查看GitVersion的来源。作者写了一个与之相关的 TFS/VSTS 任务。该工具的核心是纯C#。
这是他们的 TFS 任务的代码
https://github.com/GitTools/GitVersion/tree/master/src/GitVersionTfsTask
这是您要在构建中使用的任务
https://marketplace.visualstudio.com/items?itemName=gittools.gitversion#overview
关于构建任务扩展,您可以指定C#应用程序,例如控制台应用程序:
"execution": {
//"PowerShell3": {
// "target": "Hello.ps1",
// "argumentFormat": ""
//}
"Process": {
"target": "..\ConsoleApplication1.exe",
"argumentFormat": "$(ConnectedServiceName) $(currentDirectory) $(ApiPortalName)"
}
}
但是 Task SDK are Typescript and PowerShell, so you can’t use the SDK in your application directly, also the newest schema has removed the extra schema info (check remove extra schema info #308),所以推荐使用 NodeJS 和 PowerShell。
我想在 C# 中组合一些 VSTS 构建/发布管理扩展,虽然我可以找到一些使用 PowerShell 的通用示例,但在 C# 中有一些示例会很方便。
任何人都可以指点我 C# VSTS 扩展示例吗?
查看GitVersion的来源。作者写了一个与之相关的 TFS/VSTS 任务。该工具的核心是纯C#。
这是他们的 TFS 任务的代码 https://github.com/GitTools/GitVersion/tree/master/src/GitVersionTfsTask
这是您要在构建中使用的任务 https://marketplace.visualstudio.com/items?itemName=gittools.gitversion#overview
关于构建任务扩展,您可以指定C#应用程序,例如控制台应用程序:
"execution": {
//"PowerShell3": {
// "target": "Hello.ps1",
// "argumentFormat": ""
//}
"Process": {
"target": "..\ConsoleApplication1.exe",
"argumentFormat": "$(ConnectedServiceName) $(currentDirectory) $(ApiPortalName)"
}
}
但是 Task SDK are Typescript and PowerShell, so you can’t use the SDK in your application directly, also the newest schema has removed the extra schema info (check remove extra schema info #308),所以推荐使用 NodeJS 和 PowerShell。