|Perform site.xml "Build All" programmatically [message #876442]
||Thu, 24 May 2012 15:50
| Mohammed Ajmal
Registered: July 2009
I want to be able to perform the "Build All" action programmatically. Specifically, what I want to accomplish is start with a site.xml that a user has added some features to and generate the features/plugins directories and the p2 metadata (content.jar, artifacts.jar) programmatically.
I've already looked at the UpdateSite publisher (wiki.eclipse.org/Equinox/p2/Publisher#UpdateSite_Publisher_Application). This works great to produce the p2 metadata but requires the features/plugins as input (along with the site.xml).
Browsing the code, I actually know exactly how to accomplish what I want (see snippet below), but this references internal classes and of course, I'd like to avoid that. Any thoughts? I'm looking for some public API that accomplishes this same behaviour.
WorkspaceSiteModel wsm = new WorkspaceSiteModel(project.getFile("site.xml"));
SiteBuildOperation sbo = new SiteBuildOperation(getFeatureModels(wsm.getSite().getFeatures()), wsm, "Test job");
Where getFeatureModels() is taken from org.eclipse.pde.internal.ui.editor.site.SiteEditor.
It would actually be ideal if these classes were themselves public! There's quite a lot being done in those couple of simple lines of code... Thanks for your help.
Powered by FUDForum
. Page generated in 0.01560 seconds