Question

the following scenario:

We wanna use one root-folder for our eclipse projects. Since i saw, that eclipse don't support multi-user workspaces (many user at the same time on the same workspace), i was looking for another solution.

Randomly i created a "New Project" with no default location, but rather than our location outside the workspace (every client getting his own workspace).

Eclipse will generate under {workspace}/.metadata/.plugings/org.eclipse.core.resources/.projects/

an folder that just holds information about the location of the project and some other data (.safeable, .tree). So it's possible to rename a project and it automatically refresh's at the other client's. For the most part, it doesn't look so bad.

My Question: I have a bad feeling with that. To create those "linked projects" through source-code, i need to use "internal packages". And i'm not sure, if this is the proper behavior at all.

So how you guys would handle a scenario, where some user's need to share binary-data in a eclipse application. SVN and .git are not very comfortable with binary-files.

I appreciate any suggestions. Thanks.

Update

How i solved the problem:

Every User has his own workspace. Beside of that, there is the "central-workspace". It's just a normal workspace, but from where every IProject in the user-workspace get linked.

Here's the source-code to link a IProject that's located outside the own workspace:

IProjectDescription description = null;
description = ResourcesPlugin.getWorkspace().loadProjectDescription(new Path(path +"/.project"));
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(description.getName());
project.create(description, IProject.FORCE, null);
if (!project.isOpen()) {
    project.open(null);
}

You should run this code in a WorkspaceJob.

After that, you can work with IProject's which are not really located in your workspace with unlimited users. And in that case, you don't use any internal packages.

Était-ce utile?

La solution

Sharing project's is possible with Eclipse but there are some important points which you need to keep in mind:

Eclipse doesn't expect someone else to modify the files in a project. This is especially true when a compiler is assigned to the project. If you have a Java project, there is a Java compiler and this compiler will get really confused if someone else changes the files in the output folder. Never shared projects which have a compiler/builder.

Another solution is to put the binary data in a shared location on the file system and then import them into your project using links. See the online help for Creating linked resources. This doesn't copy the files, it just makes the resources appear in the view.

So this approach works well if you need to see the files but it doesn't help when code in the project needs to access them (say, unit tests) because these links are purely virtual: They only exist in the Eclipse UI.

Lastly, both SVN and git can cope perfectly well with binary data. They might need a lot of memory when you checkout/update/commit but if the data doesn't change, you should be perfectly fine (unless the data is > 1GB).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top