如何组织“项目”和“溶液”在Eclipse中? [英] How to organize "projects" and "solutions" in Eclipse?

查看:111
本文介绍了如何组织“项目”和“溶液”在Eclipse中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被告知Eclipse工作区与Visual Studio解决方案相当。但是我也被告知,人们通常使用一个工作区来完成所有的工作。这些明显矛盾的陈述是否正确?如果是,我们如何在Eclipse中创建和维护多个VS解决方案的相当?



其次,在VS的情况下,我检查我的解决方案(.sln )文件也进入源代码控制。相应地,应该或不应该检查Eclipse工作区的.metadata文件夹?

解决方案

我不认为Eclipse工作空间相当于VS解决方案。 Eclipse工作空间存储有关项目,其物理位置(可能位于工作空间文件夹中或外部)等的元信息,甚至工作台设置。将这些信息上传到源代码控制中并不是个好主意,因为其他开发人员可能会使用项目的其他物理位置等。



有一个类似的概念在Eclipse中的解决方案(类似,不等效):项目集。它只是一个GUI选项将您的项目分组。这些集合无法一起执行,只能在Project导航器中显示。



另一种方法是创建多个工作区文件夹,您可以使用它们作为解决方案的替代方法。这种方法的缺点是,如果您自定义IDE(例如,通过使用首选项或通过定义源代码控制位置),则必须在每个工作区中进行这些自定义。可以使用工作空间机制工具(I haven' t尝试了,但它可以迁移这些设置)。


I've been told that an Eclipse workspace is the equivalent of a Visual Studio solution. But I've also been told that people commonly use a single workspace for all their work. Are these apparently conflicting statements correct? If yes, how do we then create and maintain the equivalent of multiple VS solutions in Eclipse?

Secondly, in the case of VS, I check in my solution (.sln) files, too, into source control. Correspondingly, should I or should I not check in the Eclipse workspace's .metadata folder?

解决方案

I don't think, the Eclipse workspace is equivalent to the VS solution. An Eclipse workspace stores a lot of meta-information about projects, their physical location (possibly in or outside of the workspace folder), etc., and even workbench settings. It is not a good idea to upload this information into source control, as it is possible that other developer uses other physical locations for the projects, etc.

There is a similar concept in Eclipse to the solutions (similar, not equivalent): Project sets. It is only a GUI option to group your projects into sets. These sets cannot be executed together, and is only visible in the Project navigator.

Another way is to create multiple workspace folders, and you can use them as an alternative to solutions. The drawback of this approach is, that if you customize the IDE (e.g. by using Preferences, or by defining source control locations), these customizations have to be made in every workspace. This issue can be handled using the Workspace Mechanic tool (I haven't tried it, but it can migrate these settings).

这篇关于如何组织“项目”和“溶液”在Eclipse中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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