有没有办法相对于.project文件设置链接资源? [英] Is there a way to setup Linked Resources relative to the .project file?

查看:565
本文介绍了有没有办法相对于.project文件设置链接资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个Flash Builder(基于Eclipse)项目,该项目从不同的位置提取源代码,包含在项目所在的源代码控制中。根据我们的组织要求,源代码位于不在项目目录下的目录中。最初我们遇到的问题是所有链接资源的路径是绝对的,并且不能在其他具有不同路径的机器上运行。

We have a Flash Builder (which is based on Eclipse) project that pulls source from different locations, included in the source control in which the project is. As per our organization requirements, the source code is present in directories not directly under the project directory. Initially we had the problem that all paths to the linked resources were absolute and did not work on other machines with different paths.

现在,我们为此提供的解决方案是设置指向工作文件夹根目录的链接资源路径变量。所有其他位置都是基于这一点的,所以我们可以包括源文件夹,如

Right now, the solution we have for this is to set up a Linked Resource Path Variable that points to the root of the working folder. All other locations are based on that, so we can include source from folders like

${WORKING_BASE}/library1
${WORKING_BASE}/library2

此解决方案的问题是,拉动项目的每个人都必须设置WORKING_BASE变量正确打开项目之前工作。我的问题是,有没有办法使链接资源相对于.project文件的位置?这将是理想的。

The problem with this solution is that everyone that pulls the project has to set the WORKING_BASE variable correctly before opening the project for it to work. My question is, is there a way to make the Linked Resources relative to the location of the .project file? That would be ideal.

推荐答案

可以从Eclipse 3.6(Helios)

It is possible since Eclipse 3.6 (Helios)

打开项目属性,然后转到资源>链接的资源>路径变量。

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

可以在其中创建一个与现有变量相关的新变量。例如:

名称:MY_SOURCE_FOLDER

位置:$ {PROJECT_LOC} \..\src

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

这将在您的.project文件中添加一个新的Path变量,值为:

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

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

意思 $ {PARENT-1-PROJECT_LOC} / src ,其中 1 表示父目录超过PROJECT_LOC 1次。

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

这篇关于有没有办法相对于.project文件设置链接资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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