我正在使用 Eclipse (Helios 3.6.2) 和 Android SDK。
有没有办法在不使用符号链接(symbolic link)的情况下完成此任务?
Template Project: this is the "Main" Project. All other projects will derive from this.
- src
- A.java
- B.java
- layout
- j.xml
- l.xml
- drawable
- x.png
- y.png
Customer 1 Project:
- src
- A.java (from template)
- B.java (not from template. custom file used only in this project)
- layout
- j.xml (from template)
- l.xml (not from template. custom file used only in this project)
- drawable
- x.png (from template)
- y.png (not from template. custom file used only in this project)
Customer 2 Project:
- src
- A.java (from template)
- B.java (from template)
- layout
- j.xml (from template)
- l.xml (from template)
- drawable
- x.png (not from template. custom file used only in this project)
- y.png (not from template. custom file used only in this project)
Customer "N" Project:
and so on with many combinations of using/not using from template...
(This is for illustration only. My real projects have hundreds of files of course)
我是 Eclipse 的新手。在 VisualStudio 中,我可以通过引用添加文件来做到这一点。我在 Eclipse 中找不到类似的东西。
最佳答案
您可以提供项目引用,但我认为这不是您正在寻找的。所以这里有一个简短的解释:
您当前的工作区中必须有Customer 1 Project
和Template Project
。然后在Package Explorer
中右键单击Customer 1 Project
并选择Build Path ->Configure Build Path...
这里转到项目
选项卡并选择添加...
。在此处选择您的模板项目
。
如果来自 Customer 1 Project
的 B.java
和 Template Project
位于同一个包中(它可能是)。因此您必须为该类选择另一个名称。
关于eclipse - 最佳实践 : sharing files between projects in Eclipse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8257229/