问题描述
我们正在转向TFS 2010(来自PVCS)进行源代码管理和工作项目跟踪
We are moving to TFS 2010 (from PVCS) for source control and work item tracking
据了解,您应该对每个TFS项目的源代码控制一切这些项目解决方案等需要构建。
As I understand it you should have under source control for each TFS project everything that projects solutions, etc. need to build.
这对于新的.NET解决方案/项目来说是可行的,但是我们拥有大量的遗产 Delphi 6 具有共享源库的项目,我们希望将其导入TFS进行源代码控制和构建。这是我们如何管理多个TFS项目,希望在这些项目之间提供一组特定的源文件,这是我的问题。
This OK for new .NET solutions/projects, but we have a large collection of legacy Delphi 6 projects with shared source libraries we want to port into TFS for source control and build. It is how we manage multiple TFS projects that want to sare a specific set of source files between them that is my problem here.
从历史上来看,我们已经为每个项目解决方案(例如A& B),以及一个常用源代码的单独项目(例如C)。用户将获得C然后获得A或B(根据需要检出)在磁盘上,这将像这样:
Historically with PVCS we have had projects for each solution (say A & B), and a seperate project for common source code (say C). Users would get C then get either A or B (checking out as required) on disk this would maifest as something like this:
$\Projects\C
$\Projects\B
但B& ; C是独立的PVCS档案。
But B & C are seperate PVCS archives.
现在,以TFS 2010作为我们的ALM解决方案快速前进...
Now fast forward to life with TFS 2010 as our ALM solution...
如果我们创建一个包含常用代码(C)的源存储库的TFS项目(1),那么该项目可以很容易地访问它(假设TFS项目还包含解决方案A),而且一切都很好。
If we create a TFS project (1) that contains the source repository for the common code (C), that projecs can obviously access it (lets say the TFS project also contains the solution A) and all is good.
我们现在创建一个新的TFS项目(2)来解决方案B. Beacuse解决方案B与解决方案相悖A我们没有理由分享TFS项目1的源代码管理,所以我们创建了一个新的源代码库,而不是从1分支。现在我们发现需要解决方案B从C(1)中访问一些常见的文件。糟糕!
We now create a new TFS project (2) in which to make solution B. Beacuse solution B is wildy different to solution A we had no reason to share TFS project 1's source control so we made a new source repository rather than branching from 1. Now later on we discover a need for solution B to access some common files from C (in 1). Oops!
问题是这样的;我可以执行一些源代码控制wizzardry,让我在2的soruce控件中添加一个文件夹(为了窃取文件系统术语)符号链接到1的源代码控件中的常用代码C?
The question is this; can I perform some source control wizzardry that lets me add a folder in the 2's soruce control that is a (to steal a file system term) symbolic link into 1's source control for the common code C?
编辑
我应该指出这是所有旧代码,共享源库(C)就是它不会构建到库中的共享源或其他二进制,我们可以简单地添加到A或B。
Edit
I should point out this is all legacy code and the shared source library (C) is just that shared source it does not build into a library or other binary we could simply add to A or B.
推荐答案
在TFS 2010中,您可能知道,他们介绍了的项目集合(PC)。每个项目集合是团队项目(TP)的聚合。每个 PC 存储在单独的数据库中,VCS存储在数据库中。
In TFS 2010, as you may know, they introduced the concept of a project collection (PC). Each project collection is an aggregate for team projects (TP). Each PC is stored in a separate database, and the VCS is stored in the database.
这意味着每个PC有一个VCS存储库,不是TP。每个TP(默认情况下)每个VCS中的根文件夹(即TP1将在$ / Prj1,TP2可能在4 / Prj2等)。
This means that there is one VCS repository per PC, not TP. Each TP is (by default) the root folder in each VCS (i.e. TP1 will be at $/Prj1, TP2 might be at 4/Prj2, etc.)
更重要的是,您不想每个TP都有一个解决方案。将TP视为一套产品,并将其作为其中的一个解决方案。
One more point is that you do not want to have one solution per TP. Think of a TP as a suite of products, and a solution as a part of that.
根据Visual Source Safe的符号链接不再存在于TFS中,我不确定你需要他们在一个解决方案和另一个解决方案的源代码之间创建依赖关系不是一个好习惯。
Symbolic links, as per Visual Source Safe, no longer exist in TFS, and I'm not sure you need them. It is not considered a good practice to create a dependency between one solution and the source code of another solution.
我建议你做什么,您的代码库中的每个解决方案仅依赖于其他解决方案二进制交付 中的代码和。
What I suggest you do, is have each solution in your codebase depend only on its own code, and on other solutions' binary deliveries.
如果Sln_A依赖于Common_Sln,您将构建Common_Sln,并将其二进制文件作为您的 Get 的一部分从放置位置引入。然后,将二进制文件添加为引用。
What will happen is that if Sln_A depends on Common_Sln, you will build Common_Sln, and bring its binaries from the drop location as part of your Get. Then, add the binaries as references.
这将解决您的问题,另外还有一个好处是,将依赖关系变为依赖关系可能会破坏您的依赖解决方案的构建情况,您不要更改或升级您的依赖关系,直到他们准备就绪。您已经准备好了。
This will solve your problem, with the added benefit of transforming a tight coupling where a dependency may break your dependent solution's build, into a situation where you do not change or upgrade your dependencies until they are ready and you are ready for them.
这有助于解决您的问题吗?这是我如何处理我咨询的项目。
Does this help solve your problem? This is how I do this with the projects I consult on.
HTH,
Assaf。
HTH,Assaf.
这篇关于从另一个TFS项目中链接TFS源代码管理文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!