|
|
|
Re: How to create a RCP programatically? [message #489406 is a reply to message #489154] |
Fri, 02 October 2009 20:37 |
Andrew Niefer 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03571 seconds