TFS自定义构建任务-多个版本 [英] TFS Custom Build Tasks - Multiple versions

查看:57
本文介绍了TFS自定义构建任务-多个版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要对自定义TFS构建任务进行更改.我想在扩展程序中捆绑任务的新版本(也保留当前版本),并能够在编辑构建/发布定义时选择版本.

I need to make changes to a custom TFS build task. I'd like to bundle the new version of the task in my extension (leaving the current version in as well) and be able to select the version when editing a build/release definition.

我查看了Microsoft的

I've looked over Microsoft's documentation for bundling multiple versions of a build task within one extension, but I'm not seeing the details of what needs to be included in the extension manifest.

我还查看了 github上的VSTS任务,但没有看到如何做到这一点.

I've also looked at the VSTS Tasks on github and I'm not seeing how to accomplish this.

有没有人举过一个例子,说明如何将一个任务的多个版本捆绑在一个扩展程序中?

Does anyone have an example of how to bundle multiple versions of a task in one extension?

推荐答案

此方法适用于Visual Studio Team Services,您可能必须等到TFS 2017u2出来才能针对TFS进行此操作.

This works for Visual Studio Team Services, you may have to wait until TFS 2017u2 is out to be able to do this against TFS.

  • 为两个任务( Task )创建一个父文件夹
  • 将每个构建任务放在其自己的文件夹( Task \ TaskV1 Task \ TaskV2 )中.
  • 确保task.json中的主要版本不同.
  • 确保它们具有相同的TaskID和TaskName
  • 在vss-extension.json中包含两个版本的文件
  • 在vss-extension.json中,该任务包含一个贡献,并且仅引用父文件夹( Task ).
  • Create a parent folder for both tasks (Task)
  • Put each build task in its own folder (Task\TaskV1, Task\TaskV2).
  • Make sure they're different by major version in the task.json
  • Make sure they have the same TaskID and TaskName
  • In the vss-extension.json include the files for both versions
  • In the vss-extension.json include a single contribution for the task and reference only the parent folder (Task).

像这样:

 "contributions": [ 
     { 
         "id": "Task", 
         "type": "ms.vss-distributed-task.task", 
         "targets": [ "ms.vss-distributed-task.tasks" ], 
         "properties": { "name": "Task" } // reference task root folder here.
     },
 ]

另请参见

这篇关于TFS自定义构建任务-多个版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆