Is there a way to setup Linked Resources relative to the .project file?

让人想犯罪 __ 提交于 2019-11-28 05:01:26
Matthias

It is possible since Eclipse 3.6 (Helios)

Open the project properties and goto Resources > Linked Resources > Path Variables.

There you can create a new variable relative to an existing one. For instance:
Name: MY_SOURCE_FOLDER
Location: ${PROJECT_LOC}\..\src

This will add a new Path variable to your .project file with a value like:

$%7BPARENT-1-PROJECT_LOC%7D/src

meaning ${PARENT-1-PROJECT_LOC}/src, where the 1 means the parent directory 1 times above PROJECT_LOC.

With eclipse 3.7, giving this path :

C:\projects\workspace\project1
C:\projects\workspace\project2

Within project1 you can do :

PROJECT_LOC => C:\projects\workspace\project1
PARENT-1-PROJECT_LOC => C:\projects\workspace
PARENT-2-PROJECT_LOC => C:\projects\
PARENT-1-PROJECT_LOC\project2 => C:\projects\workspace\project2
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!