在TFS中的解决方案之间共享代码 [英] Sharing code between solutions in TFS

查看:120
本文介绍了在TFS中的解决方案之间共享代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些不同的应用程序,我需要在这些应用程序之间共享代码以减少维护。我已经尝试了很多关于stackoverflow和网络的知识,这是一个相当普遍的问题。我没有找到喜欢的答案。

I have a few different applications that i need to share code between to reduce maintenance. I have tried to read a lot on stackoverflow and the web in general and it is a fairly common problem; i have not found an answer i like.

我们的TFS分支结构是这样的。我们有三个分支,开发,主要和生产。在开发分支上,所有活动的开发都已完成,当我们完成新功能的开发后,我们将其与Main合并,然后进行生产。生产分支始终是服务器上运行的代码。如果我们检测到必须在下次迭代之前修复的错误。所做的更改主要是完成的,并在我们部署时与Production合并。需要共享代码的应用程序不共享公共分支层次结构或公共迭代计划。实际上,其中一个应用程序每年仅进行一次为期1个月的迭代。 (我知道这与传统的做法略有不同。

Our TFS branching structure is like this. We have three branches Development, Main and Production. On the Development branch all active development is done, when we are done with developing new features, we merge it with Main, and then to production. The production branch is always the code running on the servers. If we detect bugs that must be fixed before the next iteration. The changes are done in main, and merged with Production as we deploy. The applications that need to share code do not share a common branching hierarchy or a common iteration schedule. In fact one of the applications only go through a 1month iteration once a year. (I know this differs slightly from the conventional way of doing it.

在研究期间,我发现了几种不同的解决方案,但我对所有这些问题都有疑问。

During my research i have found a few different solutions, but i have problems with all of them.

二进制共享:
我发现的常见方法之一是将已编译的二进制文件分支到development分支下的一个文件夹中。我的问题是,如果我们在哪里在共享代码中检测到必须快速修复的错误后,相关代码就会被编译。如果在哪里修复错误,我们将对共享代码库进行所有更改。

Binary sharing: One of the common ways i found was branching the compiled binary into the a folder beneath the development branch. My problem is that if we where to detect bugs in the shared code that must be fixed fast, the code in question is compiled. And if we where to fix the bugs we would get all the changes done to the shared code base.

项目共享:
我的主要问题是如何以可接受的方式完成项目,最初的想法是,当新的迭代开始时,将main分支中的更改与共享代码合并到更新它,将主要部分与开发分支合并,以更新由于错误修正而导致的更改,并将共享代码的新更新版本分支到开发分支中。理解TFS不支持此操作,因为我会创建嵌套分支。

Project sharing: My main problem here is how it can be done in an acceptable manner. My initial idea was to when a new iteration started, merge the changes from the main branch with the shared code to update it. Merge the main with the development branch to update the development branch with changes as a result of bugfixing. And branch new updates version of the shared code into the development branch. But from what i understand this is not supported by TFS because i would create nested branches.

我的问题是:
我如何才能在解决方案之间共享一些共同的项目,同时保持它们的孤立性,并能够解决Main分支上的错误而不必担心关于常见项目已更改并因此引入新错误的信息。但是仍然能够修复公共项目中的错误,并将这些修复合并到共享的公共项目中。

My question is: How can i share a few common projects between solutions while keeping them in isolation and be able to fix bugs on the Main branch without worrying about the common projects having changed and therefor introducing new bugs. But still be able to fix bugs in the common project and merge those fixes back into the shared common projects.

推荐答案

谢谢大家感谢您的全部帮助,因为你们中的一些人为我的最终解决方案做出了贡献。我选择在这里发布我最终要做的事情。

Thank you everyone for all your help, because several of you contributed to my final solution iIhave chosen to post what I ended up doing here.

我最终要做的是二进制共享和代码共享

What I ended up doing was both Binary sharing and code sharing

对于经常更新且迭代速度相对较快的项目,我引用了所需的共享项目并创建了项目指南,以确保代码与特定版本向后兼容多少时间。

For the projects that is often updated and with relatively fast iterations I referenced the shared projects I needed and created project guidelines to ensure that the code was backwards compatible for specific amount of time.

对于更新频率较低的项目,我分支了已编译的二进制文件。我还创建了共享项目的版本,并创建了指南,以确保任何向后兼容的冲突代码都会导致版本号的主要部分增加。

For the projects that was updated less frequently I branched in the compiled binary. I also created versioned the shared project and created guidelines to ensure that any backwards compatibility conflicting code resulted in an increment of the main component of the version number.

这篇关于在TFS中的解决方案之间共享代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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