在Eclipse中,如何相对于项目启动配置? [英] In Eclipse, how to have launch configurations relative to the project?

查看:314
本文介绍了在Eclipse中,如何相对于项目启动配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通常有一个项目的多个副本,例如:中继线的副本和最后一个发行版分支的另一个。要将项目文件与Eclipse完全分离,它们将从Eclipse工作区外的一个目录中的Subversion中签出。



我想使项目轻松导入到Eclipse中,并遵循 multiple 答案的。



问题是我的.launch文件的项目名称是硬编码的。当导入新项目时,启动文件将显示在运行配置菜单,只要项目具有完全相同的导出的名称。这不允许我有同一个项目的两个版本。



看起来,唯一的方法是从Ant任务生成.launch和.project文件,但是我没有看到有人使用这个解决方案。也许我应该有多个工作空间,项目总是使用相同的名称。



最好的方法是什么?



编辑:标记VonC为答案,但不要错过评论。

解决方案

记住.launch配置文件不必在你的工作空间中。

他们可以在< project> /。settings 中-save-eclipse-launch-profiles-across-workspaces / 952398#952398>你所提到的答案



这意味着你不能在你的eclipse工作区同一个项目的两个版本。

您需要单独的工作区(不是自己版本),每个工作空间都指向不同路径中的项目。

每个路径都代表不同的工作树(如Subversion的不同工作目录)。






OP添加:


项目必须具有相同的名称,但项目结帐目录可以有任何名称



要使启动文件正常工作,您必须使用变量 $ {workspace_loc:ProjectName} 引用任何文件。

可以使用以下路径引用Java文件:' /ProjectName/src/package/MyFile.java '

这样,使用任何工具更容易与subversion存储库进行交互。



我想让使用Eclipse的人变得更轻松,但我不想强迫任何人使用它。



I usually have multiple copies of a project, for example: a copy of the trunk and another of the last release branch. To cleanly separate my project files from Eclipse, they are checked out from Subversion in a directory outside the Eclipse workspace.

I want to make the project easily importable to Eclipse and followed instructions from multiple answers.

The problem is that my .launch files have the project name hardcoded. When a new project is imported, the launch files will display in the Run Configurations menu just if the project has exactly the same name of the exported one. This forbids me to have two versions of the same project.

It looks like the only way to do it is to have the .launch and .project files generated from an Ant task, but I don't see anyone using this solution. Maybe I should have multiple workspaces and the project always with the same name.

What's the best way to do it?

Edit: I'm marking VonC as the answer, but don't miss the comments.

解决方案

Remember that the .launch configuration files don't have to be in your workspace.
They can be in your <project>/.settings as I mentioned in the answer you refer to.

That means you cannot import in your eclipse workspace two versions of the same project.
You need separate workspaces (not versioned themselves), each one referring to a project in a different path.
Each path represents different working trees (like different working directories for Subversion).


The OP adds:

The project must have the same name, but the project checkout dir can have any name.

To make the launch file work, you have to reference any file using the variable ${workspace_loc:ProjectName}.
Java files can be referenced using a path like: '/ProjectName/src/package/MyFile.java'
This way, it is easier to use any tool to interact with the subversion repository.

I want to make life easier for who uses Eclipse, but I don't want to force anyone to use it.

这篇关于在Eclipse中,如何相对于项目启动配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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