版本控制中多模块源项目的声明性依赖处理

发布于 2024-09-06 18:11:21 字数 344 浏览 4 评论 0原文

我们有许多产品由大量模块组成,其中一些模块在某些产品之间共享。它们分布在几个版本控制存储库中。

产品由主 Ant 脚本构建,该脚本负责检查所有模块并按正确的顺序构建它们。这些模块没有自己的发布周期。

现在,我非常想进行声明式依赖管理,但似乎所有解决方案(Maven、Ivy)都依赖于工件而不是版本控制下的源代码。依赖文物会让我们的头脑变得混乱,所以我宁愿不这样做。我想要像 Ivy 这样的东西,但是我可以说我的产品依赖于模块 foo、bar 和 baz(分支 2.0),并且它会从一个或多个源代码管理器(在某些配置中指定)检查源代码平坦的工作空间。

我计划使用 gradle 进行构建,所以适合的解决方案将非常感激......

We have a number of products that consist of a large number of modules, some of which are shared between some of the products. They are spread out over a few version control repositories.

Products are built by master Ant scripts that are responsible for checking out all modules and building them in the correct order. The modules don't have release cycles of their own.

Now, I'd very much like to go to declarative dependency management, but it seems that all solutions (Maven, Ivy) depend on artifacts rather than on source code under version control. Depending on artifacts would turn things on the head for us, so I'd rather not. I'd like something like Ivy, but where I can say that my product depend on modules foo, bar and baz (branch 2.0) and it would check out the source code from one or more source code managers (specified in some configuration) to a flat workspace.

I plan to use gradle for building, so a solution that fits with that would be much appreciated...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱的十字路口 2024-09-13 18:11:21

Gradle 嵌入了 ivy 项目来进行依赖管理,因此您将面临同样的问题。

依赖管理是一种机制,可以将大型整体构建分解为较小的组件构建,每个组件将其输出发布到公共存储库中以供其他依赖模块使用。

因此,这意味着您必须首先做出明智的决定来分解大型构建,或者干脆选择使用依赖项管理来控制第 3 方开源库。

假设您无法控制拥有多个 SCM 存储库的事实,我可以推荐以下方法来创建集中式构建(我假设您正在使用 ANT + subversion):

1)
创建包含子模块的主项目

2) 每个子模块都作为 外部定义。这使得主项目的一次检出能够自动检出每个子项目

3) build.xml 主项目包含一个使用 ivy buildlist 任务,根据各个子项目中声明的依赖关系以正确的顺序构建子项目项目 ivy.xml 文件。

多项目构建的示例是

Gradle embeds the ivy project for it's dependency management so you'll be facing the same sorts of issues.

Dependency management is a mechanism that enables a large monolithic build to be broken up into smaller component builds, each publishing their output into a common repository for use by other dependent modules.

So this means you must first make a concious decision to break up your large build, or simply settle for using dependency management to control 3rd party open source libraries.

Assuming you have no control over the fact that you have multiple SCM repositories I can recommend the following approach to create a centralized build (I'm assuming you're using ANT + subversion):

1)
Create a master project that contains your child modules

2) Each child module is added to the master project as an external definition. This enables one checkout of the master to, in turn, checkout each child project automatically

3) The build.xml master project contains a build file that uses the ivy buildlist task to build the child projects in the correct order based on the declared dependencies within the various child project ivy.xml files.

An example of a multi-project build is here

云仙小弟 2024-09-13 18:11:21

我认为 Refix 就是您所追求的: http://refix.codeplex.com/

I think Refix is what you are after: http://refix.codeplex.com/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文