[p4] Trying to use Perforce via Eclipse

Jeff Jensen jeffjensen at upstairstechnology.com
Wed Oct 12 09:39:28 PDT 2005

Quoting Janine Sisk <janine at furfly.net>:

> Thanks, Jeff -  this is useful info.
> On Oct 12, 2005, at 6:17 AM, Jeff Jensen wrote:
> > - The Perforce workspace contains the real assets - the source files.
> Ah, ok.  So this is normal then.   I have only worked with Eclipse a
> few times and then I was going through tutorials where I created the
> files in Eclipse.  In that case it puts them in it's workspace (at
> least that's what I remember it doing) so I thought that is where
> source is supposed to be.

That would occur because, when you created the project, you left the "default
location" on (which it defaults to putting the source files in the Eclipse
workspace area - a Bad Thing (TM) in my opinion) instead of specifying a
separate location for the source files.

> > - To import an existing project into Eclipse, it must already be a
> > proper
> > Eclipse project, and that means the directory selected for import must
> > contain a .project file.
> In the Depot the only .project files are in the directories under
> projects, so that makes sense that those are the only ones that
> Eclipse recognizes as projects.  But then why does it work ok if I
> use Eclipse's Import to get the files from disk instead of doing it
> through the plugin?

Sorry, I am not sure on that!  On an empty workspace, I have always populated
the files via P4V first, used "File -> Import" to setup the existing Eclipse
projects, then setup the plugin on the local project files.  Maybe someone else
can answer this one...

> Actually I should say it works differently, not that it works ok.  I
> just tried doing an import of external project again.  It builds when
> it loads, and then I have a working Clean option in the Project menu,
> which I don't have when I import from Perforce, and I don't get any
> of the missing dependency errors so the projects know about each
> other, but I still don't seem to have any way to rebuild after
> cleaning.  The Build Project item is greyed out.  So something is
> still not right, but things are in worse shape if I get the code from
> Perforce.

I think the "Build Project" is disabled because you have the "Perform build
automatically on resource modification" option on in preferences (it is on by
default; it is one of the first things I turn off!).  Turn that off, and then
the build is fully under your control:
Window -> Preferences -> Workbench -> Perform build automatically...

And while you are there, I suggest checking on "Refresh Workspace on startup".

More information about the perforce-user mailing list