[Cross-posted from the Forum One Tech Blog]
I recently upgraded Eclipse PDT to the most recent version, and I decided to figure out something that had been bugging me: why couldn’t Eclipse use a project I’d already checked out via the command line to the same workspace?
A colleague suggested that I could indeed do it, and that I just needed to start a new project but check “Create project from existing source.” This does work, but it has a couple of restrictions that explain why I was having so many problems and why it’s kind of useless for me.
- Projects from existing sources cannot be in your workspace. I have no idea why this restriction exists. I could understand why starting a project inside another project would be bad, but all Eclipse has to do is add a couple of extra files to a directory. Nonetheless, all the sites I’d set up in my workspace and had been using other text editors to edit were unusable. Coda, by contrast, will happily take over an existing project, no matter where it is or what is in it. Interestingly, you can set up a workspace inside another workspace, so I could get around this by creating another workspace that pointed to a subfolder of my current workspace that contained the source code I wanted to use.
- If using subversion, Subclipse will not be able to work with your checked out copy if the versioned files are in a subdirectory of your project. This is also strange to me. In Drupal, for example, we only version the
sites/alldirectory and use Drush to update the main application. In other projects, we have versioned code outside the public root and create the public root from a tarball we keep in the repository. Since these files have configurations that shouldn’t be versioned, I want to be able to edit them in Eclipse while using Subclipse to control the versioned part. Sadly, this restriction means I can’t do that.
So my workflow is still to create subdirectories, including a public root, in my workspace by hand, and then importing the project from Subversion with Eclipse’s Import function. These seem like pointless restrictions to me. If anybody knows a workaround, I’d be grateful.