views:

299

answers:

4

I'm using eclipse to work on a HUGE C project and it works generally well except for not being able to change views. I create a new project and set the project source to the clearcase vob directory and it works just fine except it stores the project files in the vob. then when I change views the project cant be opened because its meta-data is sitting in the old view. I can create a new project but eclipse refuses to have two projects with the same path so I (probably unwisely) remove the original project and create it again. I'm spending too much time waiting for the indexer every time I switch views.

How can I switch views with out having to re-index everything?

+1  A: 

Are you talking about snapshot or dynamic views here?
The path should be unique per view in both cases anyway.

In either case, what eclipse will not let you do is to have, in the same (eclipse) workspace, two projects with the same (eclipse) name.
You can try:

  • to have them in two different workspaces
  • to have a different .project per view (with a different name), provided those views reference the LATEST of two different branches.
    (as As mentioned earlier in Which eclipse files belong under Version Control, those two files -- .project and .classpath -- can be under version control, provided they only use relative path.)
VonC
+1  A: 

I also worked on a project that used ClearCase with Eclipse. The same kind of drama that you describe happened to us on a regular basis. ClearCase was a big part of my reason for leaving that job.

With some distance between me an that horror, I've thought up a possible solution: Set up several different installations of Eclipse, with not just separate workspaces but separate .metadata and related stuff. Check out into separate Eclipses from the different views, then shut down one and fire up another to work with another view.

I haven't tried this, but it seems to me this should work.

Oh yes, you'll want to export your preferences between Eclipse installations.

Carl Smotricz
how should I keep the preferences in sync (i simply can not work in an un customized eclipse)
Arthur Ulfeldt
Somewhat unexpectedly, the File|Export menu allows you to export preferences. Haven't done it in a while.
Carl Smotricz
+1  A: 

Perhaps the answer here is not to let clearcase anywhere near your workspace?

Use 'create project from existing source', so that the project lives inside the clearcase view, instead of having the project live in the workspace with a source folder inside the view.

Then you can have one workspace for each of your views.

This does imply checking in .cproject, .project, .classpath, etc.

bmargulies
i used mercurial to manage the changes between the view and clearcase though wen i said the project was HUGE it meant it. I actually could not fit more than two copies in my 5 gig quota.
Arthur Ulfeldt
Well, if you just check in the eclipse . files, then they stick around consistently as you check out different versions.
bmargulies
+1 for the first sentence!
Carl Smotricz
A: 

if i switch view and use the same project it sometimes works if I manually copy .cproject and .project from one view to the other.

Arthur Ulfeldt