在Eclipse中如何管理混帐子模块子项目? [英] How do I manage git submodule subprojects in Eclipse?

查看:258
本文介绍了在Eclipse中如何管理混帐子模块子项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(如果它的事项,这是Java的Andr​​oid项目)

(In case it matters, these are Java Android projects)

项目的 A 是库项目。

项目的 B 依赖于 A 。为了便于项目管理的全线为其他人而不是只是我, A 包含在 B 通过git的子模块。

Project B depends on A. For ease of project management across the board for other people instead of just me, A is contained within B via a git submodule.

这意味着,如果我想修改的两个 A B ,我会具备以下条件:

This means, if I want to make changes to both A and B, I will have the following:

  1. 项目的 A 本身
  2. 项目的 B
  3. B A ,姑且称之为 A的子模块。同一code,相同的项目名称,在磁盘上的不同位置。
  1. Project A itself
  2. Project B
  3. B's submodule of A, let's call it A'. Same code, same project name, different location on disk.

在理想情况下,我想能够满足以下条件:

Ideally I would like to be able to meet the following conditions:

  1. 能够修改 A 本身直接在Eclipse中。
  2. 能够修改 B ,并把它打造,引用 A',所有在Eclipse中。
  3. 在我并不真正需要的 A'作为一个导入的项目/无需修改它,但我想它会自动建立自己的jar文件,并有被引用的
  1. Be able to modify A itself directly within Eclipse.
  2. Be able to modify B and have it build, referencing A', all within Eclipse.
  3. I don't really need A' as an imported project / no need to modify it, but I'd like it to automatically build its jar file and have that be referenced by B.

我已经试过:

  1. 在简单地导入这两种 A A':不行的,因为Eclipse不能使用相同的名称导入两个项目。我不能简单地更改名称可能是因为它是一个子模块;就必须做到这一点的每个git的更新的,不可接受的。
  2. 添加外部库引用为 A',保持它的Eclipse完全是:其实不是太糟糕了一个解决方案,但需要在命令行中至少一个外部构建它(使用蚂蚁)前,将工作...不是最方便的。
  3. 在做一个来源链接:不是最干净的,因为 A (以及随后的 A')具有在其中多个源文件夹,所以我必须更新,每次我在 A 添加或删除源文件夹。我宁愿只直接使用的jar。
  1. Simply importing both A and A': Doesn't work, because Eclipse cannot import two projects with the same name. I can't simply change the name either because it's a submodule; would have to do that every git update, unacceptable.
  2. Adding External Library reference to A', keeping it out of Eclipse entirely: actually not too bad of a solution, but requires at least one external build of it from the command line (using ant) before it will work...not the most convenient.
  3. Doing a Source Link: Not the cleanest because A (and subsequently A') have multiple source folders within them, so I'd have to update each time I add or remove source folders within A. I'd rather just use the jar directly.

有没有办法让这一切在Eclipse中,或者我应该做这样的事情#2,但一个附加的外部build命令来调用蚂蚁一个

Is there a way to keep this all in Eclipse, or should I do something like #2 but with an added external build command to call ant on A'?

推荐答案

我也有类似的情况。你的Git克隆后导入b以现有的(机器人)项目到Eclipse中。确保项目A初始化和更新(通过GIT)。

I have a similar situation. Import B as existing (android) project into eclipse after you git clone it. Make sure project A is initialized and updated (via git).

现在,做文件 - >导入现有的项目(机器人,如果A是一个Android项目),并转到该子模块的项目是项目的B里面添加。

Now, do file->import existing project (android if A is an Android project) and go to where the submodule A project is inside of your project B and add it.

现在你在Eclipse中两个独立的项目。您可以更改项目,它都将在项目B,因为这是这两个项目的位置。

Now you have two separate projects in eclipse. You can change both projects, and it will all be under Project B, because that is where both projects are located.

这篇关于在Eclipse中如何管理混帐子模块子项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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