【发布时间】:2017-09-03 01:39:07
【问题描述】:
假设一个项目 App 有 4 个外部模块:ModA、ModB、ModC 和 ModD 可以被其他项目以可重用的方式使用。
项目背后的想法是将项目与内部 git 子模块链接到一个名为“modules”的文件夹中。
例如相关的settings.gradle可以是:
include ':app'
include ':modules:ModA'
include ':modules:ModB'
include ':modules:ModC'
include ':modules:ModD'
这个 .gitmodules 文件一切正常:
[submodule "modules/ModA"]
path = modules/ModA
url = ssh://git@bitbucket.org/repo/ModA.git
[submodule "modules/ModB"]
path = modules/ModB
url = ssh://git@bitbucket.org/repo/ModB.git
[submodule "modules/ModC"]
path = modules/ModC
url = ssh://git@bitbucket.org/repo/ModC.git
[submodule "modules/ModD"]
path = modules/ModD
url = ssh://git@bitbucket.org/repo/ModD.git
现在,假设 ModA 与 ModC 和 ModD 有依赖关系,那么连接它们的最佳方式是什么?使用 ModC 和 ModD 将子子模块添加到 ModA 或在 maven 上部署 ModC 和 ModD 的工件并将它们用作依赖项?
模块树
- 应用程序
- 模组
- ModC
- 模组化
- 调制分贝
- ModC
- 模组化
- 模组
问题
如果 App 需要对 ModC 进行更改,这些更改只会影响到应用程序模块目录中的 modules/ModC。 ModA(具有像模块一样的 ModC)没有看到任何变化。
你有什么想法吗?我如何处理一次更改?
我对这个论点有点困惑。
【问题讨论】:
标签: git git-submodules