DVCS如何结合大型集成代码库,与多个项目共享大量通用代码? [英] DVCS how structure with large integrated code base, with multiple projects sharing much common code?

查看:98
本文介绍了DVCS如何结合大型集成代码库,与多个项目共享大量通用代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个CVS仓库,主要是Java代码。每个软件包都位于它自己的顶级目录中,就像这样,以典型的java时尚布局。

 
$ CVSROOT /my.domain.module1/src/my/domain/module1
$ CVSROOT / my.domain.module2 / src / my.domain / module2
$ CVSROOT / my.domain.share1 / src / my / domain / share1



这意味着我们可以编写构建脚本,轻松地将任何软件包组合从存储库中取出为了构建一个特定的软件。

所以如果我检出my.domain.module1,那么该模块中的构建脚本会将my.domain.share1以及。这真的促进了代码的重用。



这种方法有长处和短处 - 对今天没有真正的兴趣 - 只要这种方法可以/明智地在mercurial中复制或者git。

我可以告诉你需要为每个包定义一个整个存储库,或者每次都检出并提交整个存储库!

解决方案

听起来好像你有一个很好的设置来使用 ivy 。它可以让你的构建系统处理你的依赖关系的下拉和编译部分,并且源代码控制只跟踪模块的时间点。

然后在你常春藤的时候您可以清楚地记录其他人依赖的每个组件的版本,并且可以轻松地恢复/前进。

更喜欢使用像ivy这样的良好依赖管理器。


I have a cvs repository, with mostly java code. Each package sits in it's own top level dir, like so, with the sourced laid out in typical java fashion.

$CVSROOT/my.domain.module1/src/my/domain/module1
$CVSROOT/my.domain.module2/src/my.domain/module2
$CVSROOT/my.domain.share1/src/my/domain/share1

This means we can write build scripts that can easily pull any combination of packages out of the repository in order to build a particular shippable piece of software.

So if I checked out my.domain.module1 the build script in that module will then pull in my.domain.share1 as well. This really promotes code resuse.

The approach has strengths and weaknesses - not really interested in that today - just given this type of approach is it possible/sensible to replicate in mercurial or git.

From what I can tell you'd need to either define a whole repository per package, or checkout and commit the whole repository each time!

解决方案

It sounds like you have a great setup for using ivy. It lets your build system handle the pulldown and compile-against parts of your dependencies, and the source control just tracks point-in-time for modules.

Then in your ivy dependency files you have a clear record of what version of each component the others depended on and can revert/advance easily.

You could also use mercurial sub-repos, but I prefer using a good dependency manager like ivy.

这篇关于DVCS如何结合大型集成代码库,与多个项目共享大量通用代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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