Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pde-build-dev] Loading projects into WS in headless mode

Hello,

i am trying to integrate the Metrics plugin 
(http://metrics.sourceforge.net/) into a headless automatic build.
That metrics plugin has a couple of ant tasks for enabling calculating the 
metrics and exporting the results as xml.

The problem is that that plugin requires the code to analyze to be in the 
workspace, it needs a project in the sense of IResource (and that one is 
immediately converted internally to IJavaProject which is then used 
everywhere for the calculation).

However for the headless build i don't want to rely on a workspace prebuilt 
via the GUI. I want to always start from a clean CVS checkout.

Which would be the best way to add projects on the filesystem into the 
Workspace in headless mode?  Is there any pde-ant task for that?, i 
couldn't find any in the docu.
Or should i write some code (extra ant task) which could be called for 
instance from the  postFech target in customTargets.xml  ?

I mean code doing something along the lines:

IWorkspace ws = ResourcesPlugin.getWorkspace();
IProjectDescription pd = ws.loadProjectDescription( 
myDotProjectDescriptionFile);
String name = pd.getName();
ws.getRoot().getProject( name);
project.create( pd);
project.open( null);

(untessted, but to show the idea) ?

Thanks, cheers,

Ariel


Back to the top