product configuaration in the eclipse plugin development - eclipse

Requirements using:Eclipse Mars(4.5.2) and Jdk(1.8.0)
Problem: I have created the plug-in-project called [org.basicfamily.sirius.design].
Then the product configuration was created for the plug-in [org.basicfamily.product.demonstrator] and the plug-in project [org.basicfamily.sirius.design] was added as contents to the created product configuration and selected the required dependencies for the plug-in [org.basicfamily.sirius.design]. Now the plug-in [org.basicfamily.sirius.design] is dependent on the another plug in called [org.antlr.runtime[1.6.0,1.7.0)]. But the problem now is when I try to export the product it is giving [org.antlr.runtime[1.6.0,1.7.0)] bundle version exception plug in org.antlr.runtime[1.6.0] is not found. Because in the contents of the product configuration we can add the plug-in only with respect to name and not with respect to versions. So I want to add the plug-ins org.antlr.runtime[1.6.0],org.antlr.runtime[1.7.0] both but it allows only one plug-in with the same name. It will consider the plugins only with respect to the name and not w.r.t the versions.
Any solution for this problem?

Switch to using a 'feature' based build. In the 'feature.xml' for a feature you can specify the version of the plugin required.
So you can use a feature for the plugins which use the 1.6 plugin and another feature for the plugins requiring 1.7.

Related

Eclipse RCP plugin dependencies

I am trying to generate an RCP product from a set of Eclipse plugin. When I am trying to run the Eclipse plugin from my Eclipse.rcp.product plugin, Eclipse is asking me to add all the dependent plugins. I have done that.
However, on adding a new plugin, it starts asking for dependencies (e.g., third party libraries from Eclipse's Orbit repo) of that plugin too. All the dependencies of individual plugins are referenced in those plugins.
Why do I have to add all the references again in the RCP plugin. What is the way around or right way?
The xxx.product file must list every plugin that your RCP is going to use as this list determines what is included in the resulting product.
This is a separate list from the individual plugin dependencies.
The Dependencies tab of the .product file editor has an 'Add Required' button which should add everything that is needed (assuming you have already added all your plugins).
You can also use 'features' rather than 'plugins' for the product file which reduces the number of things that need to be included in the dependencies.

Dependencies of my RCP application are missing on my update site

I am creating an RCP application. I am planning to provide p2 update functionality.
For example there are 4 plugins: A,B,C,D
Plugin A and B represents the core functionality of my RCP application. I have created a feature with name com.myorg.feature.core. In-side the feature.xml, in the plugin tab I have added plugins A & B.
I am adding feature com.myorg.feature.core as a dependecy in the product file of my RCP applicaton. After that I export the RCP application using product file (here product is a feature based product).
Now I have created two more features.
com.myorg.feature.featureC
com.myorg.feature.featureD
As these are optional functionalities to my RCP application, I want user to chose, whether to install them or not. So user will chose the install new software option where this features will be list.
The problem I am facing is, these plugins C & D are using certain 3rd party libraries e.g. BIRT, NATTABLE. So each time, I build featureC or featureD, put it on the update site and I try to install them in my application, they show the dependency failures, like bundle missing: org.eclipse.birt.core
I go back to the feature.xml for featureC -> plugins tab -> add org.eclipse.birt.core and build feature again. But several times my RCP application failed to install with errors bundles missing.
Is there any mechanism where I can determine all the required bundle from start? Is is the right way to launch updates or new install-able units for my RCP application?
#Priank it is better to add all dependencies in plugins tab in feature.xml, this is only one time effort. You can compute required plugins from dependencies tab of feature.xml
To me, the first question should be if you really want to use the Eclipse PDE export wizards for delivering updates.
Instead, you should set up a headless build for your project. If you are familiar with the PDE (and don't happen to hate Maven ;-), Tycho is probably the right choice for you. (Disclaimer: I'm committer on the Tycho project, and may not know all potential alternatives.)
You can easily make Tycho include all the transitive dependencies in a p2 repository: Just set the option includeAllDependencies to true on the tycho-p2-repository-plugin.

Eclipse 3.7 Required Plug-ins

I am currently running Eclipse 3.7 Indigo
My current project is a Plug-in Project
I wanted to try out the product called icePDF in my existing project.
So I downloaded the two required jar files from the binary download.
icepdf-core.jar and icepdf-viewer.jar
So I created a new plug-in project from existing jars. I am added the two jar files and created the plug-in project. I then exported the project and produced a project jar file .
Went back in to my existing project where I want to use the features of icePDF.
Went to dependencies -> Required Plug-ins -> Added my new icePDF plugin.
I am sure that I am missing a key step. Because as soon as I close the icePDF project in Package Explorer. I get a error in my main project.
Error : Missing Required Plug-in
What I don't understand is I have at least 12 other required plug-ins, none of them are open.
Was this the right way to try and add the icePDF jars to my existing project? Was there a way to just incorporate the jars in to the plug-in project without having to create the new project?
EDIT
Looks like icePDF primarily uses Swing. My project is SWT based, I do not want to use Swing in the project. I am looking for something that will view a existing pdf, convert a pdf and print a pdf to local printer.
Any suggestions??
It is normal behavior that Eclipse reports an error when a required plugin is closed, if this plugin is only available through your workspace. I assume that the other required plugins are 'standard' Eclipse plugins, such as EMF; those do not have to be in your workspace, as they are directly installed into your Eclipse platform.
Another way would be to put the original Jars into your plugin project. Just create a folder, e.g. lib/, paste the Jars there, and add them to the plugin project's class path. The latter is a bit tricky, as you have to add them in the Project Properties as well as in the Manifest.ml (in the 'runtime' tab of the plugin.xml-editor, IIRC) and the build.properties file.
Please read about the Eclipse target platform, as you seem not to be aware of that concept.
Generally speaking, there is an Eclipse environment in which you develop your code (which you use), and there is another Eclipse environment, in which your developed plugin runs (i.e. which a user of your plugin uses). That second one is called "target platform" in Eclipse terms. And they can be different, e.g. you develop in Eclipse 4.2, but your plugins shall run in Eclipse 3.7.
If you don't create a target platform yourself, then Eclipse just assumes its current installation to be the target platform (i.e. your development environment). That is why all "normal" plugins can be used as dependencies without them being in the workspace. But your icePdf plugin is not part of the Eclipse installation (and therefore not part of the target platform), which is why it needs to be available in the workspace.
If you define a target platform, you can then simply add those icepdf plugins to it and don't need to have them in the workspace any longer.

Eclipse product: how to clone the plugin version?

This may sound a bit strange, but i would rather avoid having to check the product version field each time i have to make an export.
Is there a way that the product version can be updated with the Plugin version?
In our headless build, our .product file product element has version="0.9.0.#qualifier#". Our customTargets.xml has a <replace token="#qualifier#" ... on the file before we call p2.publish.product.
A product export from the Product Configuration Editor seems to auto-update the qualifier in the .product file.
If you mean syncing the main part of the product version to a plugin in the product (like the product version 1.4.2 will match plugin X 1.4.2) I don't believe there's any support for that.
PW

Eclipse RCP: building product with feature that requires other features

I need to build a product that contains one feature, I want this feature, containing application, requires another feature that can be updated independently from product, so I put this last one in required section and not in included section.
the tree is this:
it.prodotto (product id)
it.rcp.prototipo.application.feature (main feature included in product and containing application)
it.rcp.framework.feature (feature required by main feature)
My problem is this, even if I have these features (and relatively plugins) in my target, when I export my product using eclipse wizard from .product I got this error:
Cannot complete the install because one or more required items could not be found.
Software being installed: prototipo application 1.0.7 (it.prodotto 1.0.7)
Missing requirement: My Application 1.0.4 (it.rcp.prototipo.application.feature.feature.group 1.0.4) requires 'it.rcp.framework.feature.feature.group 1.0.4' but it could not be found
Cannot satisfy dependency:
I don't understand where (and how) I have to put this features before export the product
I also tried to put this required feature in the same folder where I export the product without success (I tried both launchingfolder and repository)
I'm using Eclipse Helios 3.6.1
The feature it.rcp.framework.feature must be added to the product configuration as well.