Eclipse 参考目录位于 Eclipse 项目目录之外但位于存储库内
[更新:请参阅评论]
所以可以说我有一个这样的结构:
/trunk/src
/trunk/platform/linux/[eclipse project]
/trunk/platform/windows/[eclipse project]
我希望两个项目都能够请参阅 /trunk/src,打开其文件并在这些文件上使用自动错误突出显示。我尝试过创建目录的链接资源。这在一些令人讨厌的限制下效果很好。除非您重新导入并且无法创建/删除文件,否则它永远不会更新。我尝试在 git 存储库中存储一个符号链接,但显然从 git 1.6.1 开始不再有效。无论如何,我尝试了,克隆符号链接后就被破坏了。
这实际上只是为了轻松访问多平台项目的主代码库。解决方案不必很优雅,但很重要。因此,我认为我可以指示每个开发人员将自己的符号链接到主代码库,作为开发环境设置的一部分。尝试过,这些用 ln -s 创建的符号链接似乎没有出现在 Eclipse 中,也无法导入。
最后我想我可以在 Eclipse 中的 /trunk/ 中创建一个通用项目。似乎 Eclipse 足够“聪明”,可以警告我这是不可能的,因为它会检测更深入的其他项目。
任何帮助表示赞赏。
[Update: See comments]
So lets say I have a structure like this:
/trunk/src
/trunk/platform/linux/[eclipse project]
/trunk/platform/windows/[eclipse project]
I want both project to be able to see /trunk/src, open its files and use the automatic error highlighting on those files. I've tried creating Linked Resources to the directory. This works great with nasty limitations. It never updates unless you re-import and you can't create/delete files. I tried storing a symbolic link in the git repo which apparently as of git 1.6.1 no longer works. I tried anyway and upon cloning the symbolic link comes our broken.
This is really just for ease of access to the main codebase for a multi platform project. The solution need not be elegant but it is important. So I figure I can instruct each dev to just make their own sym link to the main codebase as part of dev environment setup. Tried and these symbolic links created with ln -s do not seem to appear in Eclipse nor can they be imported.
Finally I figured I could create a General Project in /trunk/ within Eclipse. Seems Eclipse is "smart" enough to warn me that this is not possible because it detects other projects deeper in.
Any help appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,注释:
“
/trunk/xxx/yyy
”是一种 SVN 方法,其中所有分支/标签都“模拟”为目录。Git 中不需要它们。两个分支(一个“
linux
”,一个“windows
”)就足够了;那么您可以克隆您的存储库两次,一次在“windows
”目录中,一次在“linux
”目录中。关于可能的解决方案:
如果 Linux 和 Windows 平台之间关于 Eclipse 的唯一区别是
.project
和.classpath
文件,那么我实际上建议只使用一个 em> repo(用于您的源代码),具有上述两个分支,每个分支都包含源代码和 eclipse 文件(针对每个平台定制)。这样,解决方案就更容易维护:一个存储库,一个结构。两个分支。
First, a comment:
'
/trunk/xxx/yyy
' is a SVN approach, where all branches/tags are "emulated" as directory.You don't need them with Git. Two branches (one '
linux
', one 'windows
') are enough; then you can clone your repo twice, once in a 'windows
' directory, one in a 'linux
' directory.Regarding a possible solution:
If the only difference between the linux and the windows platform, regarding eclipse, are the
.project
and.classpath
files, I would actually recommend having only one repo (for your sources), with aforementioned two branches, each one including the sources and the eclipse files (tailored for each platform).That way, the solution is much easier to maintain: one repo, one structure. Two branches.