Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to create a RCP programatically?
How to create a RCP programatically? [message #488883] Wed, 30 September 2009 14:56 Go to next message
Mario Cervera is currently offline Mario CerveraFriend
Messages: 66
Registered: July 2009
Member
Hi,

I've been able to create an RCP by using a .product file where I specify
the features and plugins I want to include in the final product. I've used
the "Eclipse Product export wizard" that can be launched directly using the
multipage editor available for .product files (Product Configuration
editor). My question is the following:

Is it possible to do something like this (I mean something similar to what
the wizard does)? I've thought of checking the method
"performFinish" of the class "BaseExportWizard" of
"org.eclipse.pde.internal.ui.wizards.exports" just to see how it's done by
the editor, but everything is "internal" so I've realized the export wizard
is not intended to be launched by anyone other than the editor itself. What
can I do?

Any suggestion will be highly appreciated :-)

Thanks in advance.

Mario
Re: How to create a RCP programatically? [message #489133 is a reply to message #488883] Thu, 01 October 2009 15:05 Go to previous messageGo to next message
James Peltzer is currently offline James PeltzerFriend
Messages: 43
Registered: July 2009
Member
If your goal is to do a headless build, there are mechanisms to do this;
it's done through PDE Build and is fairly complex. Google can help you get
started.

As far as I know, the Eclipse product export wizard is using PDE Build under
the hood.

James



"Mario Cervera" <mcervera@pros.upv.es> wrote in message
news:h9vrj0$9rc$1@build.eclipse.org...
> Hi,
>
> I've been able to create an RCP by using a .product file where I specify
> the features and plugins I want to include in the final product. I've
> used the "Eclipse Product export wizard" that can be launched directly
> using the multipage editor available for .product files (Product
> Configuration editor). My question is the following:
>
> Is it possible to do something like this (I mean something similar to what
> the wizard does)? I've thought of checking the method
> "performFinish" of the class "BaseExportWizard" of
> "org.eclipse.pde.internal.ui.wizards.exports" just to see how it's done by
> the editor, but everything is "internal" so I've realized the export
> wizard is not intended to be launched by anyone other than the editor
> itself. What can I do?
>
> Any suggestion will be highly appreciated :-)
>
> Thanks in advance.
>
> Mario
>
>
Re: How to create a RCP programatically? [message #489154 is a reply to message #489133] Thu, 01 October 2009 16:03 Go to previous messageGo to next message
Mario Cervera is currently offline Mario CerveraFriend
Messages: 66
Registered: July 2009
Member
I know the wizard is usgin PDE Build under the hood ... the problem is that
I'd like to invoke that functionality too but I can't because all the code
is internal :-( ... there must be a way to export an RCP programatically but
I don't know how

Mario

"James Peltzer" <jpeltzer@rossvideo.com> escribi
Re: How to create a RCP programatically? [message #489406 is a reply to message #489154] Fri, 02 October 2009 20:37 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
If you know how to set up a headless build for your product, then you can consider programmatically generating those files in a temporary folder somewhere. And then running pde.build against that.

Consider something like:
//get pde.build template properties file
Bundle pdeBuild = Platform.getBundle("org.eclipse.pde.build");
URL templateProperties = FileLocator.find(pdeBuild, new Path("templates/headless-build/build.properties"));

//load the template properties, add the properties you need to change, and store the properties somewhere
Properties builderProperties = new Properties();
builderProperties.load( templateProperties.openStream());
builderProperties.put(...);
builderProperties.store(...);
...

//find the pde.build main build.xml
URL buildXML = FileLocator.find(pdeBuild, new Path("scripts/productBuild/productBuild.xml"));
String buildXMLPath = FileLocator.toFileURL(buildXML).getPath();

//run ant on the productBuild.xml
AntRunner runner = new AntRunner(); //from org.eclipse.ant.core
//just like the ant command line
String [] args = new String [] { "-buildfile", buildXmlPath, "-Dbuilder=" + tempFolder, ... }; 
runner.run((Object) args);


The PDE/Build junit tests do a lot of this kind of thing. You could look at them as an example. The code is in cvs host: dev.eclipse.org, repository path: /cvsroot/eclipse, project: pde/build/org.eclipse.pde.build.tests
Re: How to create a RCP programatically? [message #489827 is a reply to message #489406] Tue, 06 October 2009 07:38 Go to previous message
Mario Cervera is currently offline Mario CerveraFriend
Messages: 66
Registered: July 2009
Member
Thanks a lot :D, that looks like what I was looking for. I'll try it soon.

Mario

"Andrew Niefer" <aniefer@ca.ibm.com> escribi
Previous Topic:How to receive events for ViewPart
Next Topic:eSWT
Goto Forum:
  


Current Time: Thu Mar 28 14:22:10 GMT 2024

Powered by FUDForum. Page generated in 0.04403 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top