|
|
|
|
|
|
|
|
Re: How to create a p2 repo programmatically [message #605904 is a reply to message #537144] |
Tue, 01 June 2010 11:52  |
Eclipse User |
|
|
|
Mickael Istria wrote:
> Hi,
>
> chathuri a écrit :
>> Hi all,
>> I want to create a P2 repo programmatically with my plugin. Any
>> reference I can follow ?
>
> You should try this page: http://wiki.eclipse.org/Equinox/p2/Publisher
While the wiki doesn't show any programmatic examples, those publisher tasks
do create p2 repos, so you can go look at their source code.
The source is in cvs at dev.eclipse.org, /cvsroot/rt,
org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.publis her
As a particular example the p2.publish.featuresAndBundles ant task is
implemented by the class FeaturesAndBundlesPublisherTask, which will create
a repository or append to an existing one.
Find the repo creation code at Publisher#createMetadataRepository (and
createArtifactRepository).
-Andrew
|
|
|
Re: How to create a p2 repo programmatically [message #605908 is a reply to message #537239] |
Tue, 01 June 2010 21:13  |
Eclipse User |
|
|
|
HI,
Thanks for the info. I was able to create p2 repo half way by invoking "run" method of org.eclipse.equinox.launcher.Main() class. But the problem is, it copied only the artifacts.jar and content.jar to the given location. It did nt copy "Plugins" and "Features" folders.
I will try with the org.eclipse.equinox.p2.publisher as well..
Thanks.
Chathuri.
|
|
|
|
Re: How to create a p2 repo programmatically [message #605918 is a reply to message #537359] |
Wed, 02 June 2010 13:28  |
Eclipse User |
|
|
|
Hi Mickael,
You are correct. I was able to create a p2 repo with the example you have pointed. Only problem with that code is, in the createActions method, it does nt pick features folder. It only picks plugins folder.
public static IPublisherAction[] createActions() {
IPublisherAction[] result = new IPublisherAction[2];
File[] bundleLocations = new File[1];
bundleLocations[0] = new File("/location to bundles/");
BundlesAction bundlesAction = new BundlesAction(bundleLocations);
FeaturesAction featureAction = new FeaturesAction(bundleLocations);
result[0] = bundlesAction;
result[1] = featureAction;
return result;
}
Hope this may helpful.
Chathuri
|
|
|
|
Powered by
FUDForum. Page generated in 0.30323 seconds