最佳实践:在Eclipse中的项目之间共享文件

时间:2011-11-24 12:40:23

标签: eclipse projects-and-solutions workspace

我正在使用Eclipse(Helios 3.6.2)和Android SDK。

有没有办法在不使用符号链接的情况下完成此操作?

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中找不到类似的东西。

1 个答案:

答案 0 :(得分:2)

您可以制作项目参考,但我不认为这正是您所寻找的。所以这里有一个简短的解释: 您必须在当前工作区中拥有Customer 1 ProjectTemplate Project。然后右键点击Customer 1 Project中的Package Explorer并选择Build Path -> Configure Build Path...此处转到Projects标签,然后选择Add...。在这里选择您的Template project

如果来自B.javaCustomer 1 Project的{​​{1}}位于同一个包中(可能是这样),则此解决方案可能会导致问题。所以你必须为那个班级选择另一个名字。