在所有项目中共享组件

在所有项目中共享组件

本文介绍了在所有项目中共享组件,有没有比 svn:externals 更好的选择?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的情况:我有几个组件,有时会对它们进行更改,并且在许多不同的项目中共享.每个项目都将这些放在名为/depends 的子文件夹中.Depends 为我们所有的公共组件保存了一堆 svn 外部组件.

My situation: I have several components, which sometimes have changes to them, and are shared across a lot of different projects. Each project puts these in a subfolder called /depends. The depends holds a bunch of svn externals for all of our common components.

svn:externals 给我带来了很多时间和痛苦.

svn:externals is causing me a lot of time and pain.

  • 在项目根文件夹上显示日志不会显示 svn:external 文件夹的更改(但足够有趣的提交和更新将与 svn:externals 一起使用)
  • 分支时,svn:externals 不会分支.
  • 由于 svn:externals 上没有分支,任何更改通常都会破坏主干.
  • 标签不会冻结它们的外部.这确实违背了标记的目的.

请记住,我有几个项目(在本次讨论中假设有 10 个项目使用相同的外部组件),因此为每个项目保留正常的提交目录会花费我大量的合并时间.

Remember that I have several projects (Let's say 10 for this discussion each using the same externals), so keeping normal committed directories for each project would cost me a lot of merging time.

对于我的情况有更好的选择吗?

Is there a better alternative for my situation?

推荐答案

我认为部分问题在于共享组件的发布周期不一定与项目的发布周期匹配.

I believe part of the problem is that the release cycles for the shared components don't necessarily match the release cycles for the projects.

此处描述的共享组件有自己的发布周期.换句话说,每个项目都可以作为一个单独的项目进行管理(或者可能将它们的集合作为一个单独的项目进行管理),并拥有自己的发布/版本号.

Shared components as described here have their own release cycle. In other words each one could be managed as a separate project (or perhaps the collection of them managed as a separate project) with a release/version number all its own.

请注意,svn:externals 定义可以包含特定修订版.

Note that the svn:externals definition can include a specific revision.

这允许针对共享组件(或共享组件的集合)的特定版本/修订版开发使用共享组件的每个项目,提供一组稳定的项目的依赖项.对组件的更改不会破坏项目,因为每个项目都在查看组件的特定修订版,不一定是 trunk 上的 HEAD.

This allows each of the projects that makes use of a shared component to be developed against a specific release/revision of that shared component (or the collection of shared components), providing a stable set of dependencies for the project. Changes to the components won't break the projects because each project is looking at a specific revision of the components that isn't necessarily the HEAD on the trunk.

虽然这似乎需要更多的前期工作,但我相信从长远来看,这种做法为此类情况提供了更好的变更管理流程.

While this may seem like more work up front, I believe in the long run this practice provides a better change management process for this type of situation.

这篇关于在所有项目中共享组件,有没有比 svn:externals 更好的选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 17:48