我应该如何构造VSTS项目文件夹? [英] How should I structure my VSTS project folders?

查看:60
本文介绍了我应该如何构造VSTS项目文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图了解如何构造TFS/VSTS文件夹以及本地工作区/文件夹/映射等.我正在寻找可以遵循的最佳实践方法.

I am trying to understand how I should structure my TFS/VSTS Folders and local workspaces/folders/mappings, etc. I am looking for a best practice approach I can follow along.

目前,我的VSTS帐户中有两个项目:

Currently I have got two projects within my VSTS account:

$/ProjectA
+- Main
  +- ProjectA 
    +- ProjectA
    +- ProjectA.sln 

$/ProjectB
+- Main
  +- ProjectB 
  +- ProjectB.sln 

如该 MSDN链接我创建了一个主"文件夹位于项目的根目录.因此,我能够创建分支,以备日后需要时使用.

As suggested by this MSDN link I have created a 'main' folder at the root of the project. So I am able to create branches in case it is needed later.

请注意,ProjectA还有一个名为ProjectA的附加文件夹,该文件夹是由Visual Studio在使用新项目向导并选中添加到源代码管理"时创建的.

Please note that ProjectA has an additional folder called ProjectA, which was created by Visual Studio, when using the new project wizard and checked "Add to source control".

关于ProjectB:首先,我创建了解决方案,而没有将其添加到源代码管理中.但是随后将解决方案移到了本地映射的文件夹中.然后打开解决方案,然后选择将解决方案添加到源代码管理".

Regarding ProjectB: First I have created the solution without adding it to source control. But then later moved the solution into the folder that is locally mapped. And afterwards opened the solution and choose "Add solution to source control".

我有一个工作空间,叫做:"MyWorkspace".此工作空间内的路径映射设置如下:

I have got one workspace, called: "MyWorkspace". The path mappings within this workspace are set as follows:

$/ProjectA ==> C:\Dev\Projects\ProjectA  
$/ProjectB ==> C:\Dev\Projects\ProjectB

NB:这两个项目彼此无关.

NB: Both projects have nothing to do with each other.

问题:

  1. 如何在VSTS项目中构造文件夹? .sln文件应位于哪个级别?

  1. How should I structure my folders within the VSTS project? At which level should the .sln file reside?

我应该如何构造本地文件夹和映射?

How should I structure my local folders and the mappings?

我应该使用一个包含所有项目映射的工作区,还是每个项目使用一个工作区?还是应该按照某些博客的建议在每个项目中甚至拥有多个工作区? (对不起,找不到链接了)

Should I use one workspace containing all project-mappings or one workspace per project? Or should I even have multiple workspaces per project as suggested by some blogs? (sorry cant find the link anymore)

推荐答案

我同意Flater,这个问题是完全主观的.

I agree with Flater, This question is completely subjective.

但是,MSDN提供了有关使用服务器端结构客户端结构分支文件夹工作区的建议解释.

However MSDN provided the suggestions on using the server-side structure and client-side structure, also Branched Folders and Workspaces explained.

解决方案和项目结构的策略

用于构造解决方案和 项目文件是:

The three most common strategies used to structure solution and project files are:

  • 单一解决方案.如果您使用的是小型系统,请创建一个解决方案并将所有项目放入其中.
  • 分区解决方案.如果您在大型系统上工作,请使用多个解决方案将相关项目组合在一起.创建解决方案
    从逻辑上将开发人员最擅长的项目子集分组
    可能会修改为一组,然后创建一个主解决方案来
    包含您所有的项目.这种方法减少了
    的数量 仅在需要时需要从源代码管理中提取的数据
    从事特定项目.
  • 多种解决方案.如果您要在需要数十个或更多项目的大型系统上工作,请使用多个解决方案来工作
    在子系统上,但由于依赖关系映射和性能原因,这样做
    不要创建包含所有项目的主解决方案.
  • Single solution. If you work on a small system, create a single solution and place all of your projects within it.
  • Partitioned solution. If you work on a large system, use multiple solutions to group related projects together. Create solutions to
    logically group subsets of projects that a developer would be most
    likely to modify as a set, and then create one master solution to
    contain all of your projects. This approach reduces the amount of
    data that needs to be pulled from source control when you only need
    to work on specific projects.
  • Multiple solutions. If you are working on a very large system that requires dozens of projects or more, use multiple solutions to work
    on sub-systems but for dependency mapping and performance reasons do
    not create a master solution that contains all projects.

通常,您应该:

  • 除非结果解决方案太大而无法加载到Visual Studio中,否则请使用单一解决方案策略.
  • 使用多种解决方案在您的应用程序的子系统上创建特定的视图.
  • 使用多个解决方案可以减少加载解决方案所需的时间,并减少开发人员的构建时间.

有关详细信息,请参阅以下链接:

Please refer to below links for details:

在某些情况下,您可以创建多个工作区来隔离并在不同分支中进行的更改之间进行切换.

如果您使用的是本地工作区,则可以通过切换为"one branch == one workspace"来看到一些性能上的好处.请参阅phkelley的博客以获取详细信息:

If you’re using local workspaces, then you can see some performance benefits by switching to using "one branch == one workspace". Please refer to phkelley's blog for details:

TFS版本通过Visual Studio使用多个工作区

您还可以参考jessehouwing关于如何使用工作空间的答案: https://stackoverflow.com/a/48355207/7466674

You can also reference jessehouwing's answer on how to use the workspace: https://stackoverflow.com/a/48355207/7466674

这篇关于我应该如何构造VSTS项目文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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