Eclipse team project set to checkout Drupal & contributions for 4.6, 4.7, 5.0 and CVS

Last modified: November 3, 2007 - 00:27

Eclipse has a great feature to allow you to import a whole set of projects from CVS in one go.

To do this, simply:

1: Save the following as drupal.psf:

<?xml version="1.0" encoding="UTF-8"?>
<psf version="2.0">
<provider id="org.eclipse.team.cvs.core.cvsnature">
<project reference="1.0,:pserver:cvs.drupal.org:/cvs/drupal,drupal,drupal-head"/>
<project reference="1.0,:pserver:cvs.drupal.org:/cvs/drupal,drupal,drupal-4-6,DRUPAL-4-6"/>
<project reference="1.0,:pserver:cvs.drupal.org:/cvs/drupal,drupal,drupal-4-7,DRUPAL-4-7"/>
<project reference="1.0,:pserver:cvs.drupal.org:/cvs/drupal,drupal,drupal-5,DRUPAL-5"/>
</provider>
</psf>

2: In Eclipse choose File -> Import -> Team -> Team Project Set and browse to find your drupal.psf file. Click finish, enter your CVS user/password (or anonymous/anonymous) and go do something else for an hour or two!

This will import the 4.6, 4.7, 5.0 and CVS versions of Drupal into separate projects. If you do not need all of these you can simply remove any unwanted lines from the drupal.psf file before importing.

If you want to checkout all of contrib (which is not of great value since projects started tagging/branching and can slow down Eclipse) you can add any/all of the following lines.

<project reference="1.0,:pserver:cvs.drupal.org:/cvs/drupal-contrib,contributions,drupal-contrib-head"/>
<project reference="1.0,:pserver:cvs.drupal.org:/cvs/drupal-contrib,contributions,drupal-contrib-4-6,DRUPAL-4-6"/>
<project reference="1.0,:pserver:cvs.drupal.org:/cvs/drupal-contrib,contributions,drupal-contrib-4-7,DRUPAL-4-7"/>
<project reference="1.0,:pserver:cvs.drupal.org:/cvs/drupal-contrib,contributions,drupal-contrib-5,DRUPAL-5"/>

Not for contrib!

salvis - July 16, 2007 - 22:16

This approach is great for checking out the Drupal core versions, but the contrib directories are way too big. Eclipse (or the PHP perspective) tries to index (?) all files. With the old PHPEclipse, this did complete after many hours, but I don't know whether I could actually have worked with it, because I upgraded to PDT (to get a PHP debugger), and PDT hangs if you try to open more than one contrib project at the same time.

The problem is that if you import a Team Project Set, then all imported projects are open. Eclipse immediately starts to index them, and most of the time it was unwilling to heed my Cancel requests. I had to kill and restart Eclipse many times until I finally succeeded to close all contrib projects but one.

Even if you only have one contrib project open at a time, this is less useful than you might think, because the contrib trees are outside the Drupal core trees, i.e. you cannot run a Drupal version and hope to enable a module from a contrib tree. AFAIK, you have to copy the module to sites/all/modules under the desired Drupal tree (where it's outside CVS control), and if you make any changes and want to commit (or even just diff) them, you have to copy the modified files back to where the module project is. Also, closing one and opening another contrib project takes too long for practical use (maybe an hour, I never sat and watched).

So, in the end, I'd recommend importing the "drupal" projects above, but not the "drupal-contrib" ones. You can always import another Team Project Set, but I'd definitely go with one drupal-contrib at a time and close the ones you already have before importing another one.

This is based on Eclipse 3.2.2 (updated from 3.2.1) and PDT 1.0.0.v20070520 running under WinXP and java.runtime.version=1.5.0_09-b01.

 
 

Drupal is a registered trademark of Dries Buytaert.