Community
Participate
Working Groups
In order to better support RAP (bug 262603), we should use Import-Packages in the manifests instead of harcoding the bundles with Require-Bundle. This is based on the fact that RAP deploys the same API but within other bundles (org.eclipse.ui -> org.eclipse.rap.ui) not to clash with RCP bundles. Using Import-Packages would help to depend on the right bundles at runtime. We can leverage PDEs automatic dependency management to help with this task. If there are no objections. I'd provide a patch for this.
Another example of where we use Import-Package is com.ibm.icu.text See http://wiki.eclipse.org/ICU4J#Replacement_Plug-in Here is some discussion of possible difficulties: http://eclipsesource.com/blogs/2009/07/14/why-i-cant-recommend-using-import-package/ The alternatives appear to be: 1.Import-Package 2.Optional dependencies on both the swt and rap plugins 3.Compatibility plugin - which optionally depends on both, and reexports them 4.Would putting the dependencies in a fragment plugin work? I would like to see the patch as it seems the simplest option.
I really recommend to use Import-Packages in our situation as we will not suffer from the split package problems due to some IDE dependencies. This way it is cleaner to maintain than having optional dependencies on both runtimes. The only drawback of this approach is that we need to define unversioned package imports for the time being (see bug 286880).
By experiment, the changes for RCP seem to be to be to add org.eclipse.ui, org.eclipse.ui.help, org.eclipse.ui.intro, org.eclipse.ui.plugin, org.eclipse.ui.progress, org.eclipse.ui.themes as import-packages, remove org.eclipse.ui as a bundle and add org.eclipse.jface (which used to be reexported from the org.eclipse.ui bundle). I'll see whether they work for RAP.
I had a go and changed the following plugins to use Import-Package instead of Require-Bundle for the org.eclipse.ui. org.eclipse.mat.chart.ui org.eclipse.mat.ui org.eclipse.mat.ui.help org.eclipse.mat.ui.rcp The Tycho was fine, and the (locally) produced RCP was usable. This is just the first iteration. The dependencies are still not versioned and I didn't change the org.eclipse.mat.dtfj plugin. It has an optional reference to the org.eclipse.ui bundle. Actually I got the changes working in the IDE, but Tycho couldn't build, so for the moment I postponed the change. This is the import list for DTFJ, just to have it somewhere saved: Import-Package: com.ibm.icu.text;version="3.6.1", org.eclipse.jface.preference;resolution:=optional, org.eclipse.jface.dialogs;resolution:=optional, org.eclipse.ui;resolution:=optional, org.eclipse.ui.preferences;resolution:=optional, org.eclipse.swt.graphics;resolution:=optional, org.eclipse.swt.widgets;resolution:=optional, org.eclipse.core.commands.common;resolution:=optional About versioning - we import all UI related bundles with version 3.3.0 (which seems to be 3.3.0 and higher). I am not sure if this is still valid. What would be a good version range for the packages?
Bug 351842 might explain how to cope with optional dependencies with Tycho
I've updated the org.eclipse.mat.dtfj plugin too. Initially I got this error [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.16.0:compile (default-compile) on project org.eclipse.mat.dtfj: Compilation failure: Compilation failure: [ERROR] /opt/users/hudsonbuild/workspace/tycho-mat-nightly/trunk/plugins/org.eclipse.mat.dtfj/src/org/eclipse/mat/dtfj/DTFJPreferencePage.java:[16,0] [ERROR] import org.eclipse.ui.IWorkbench; [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] Access restriction: The type IWorkbench is not accessible due to restriction on classpath entry /opt/users/hudsonbuild/workspace/tycho-mat-nightly/.repository/p2/osgi/bundle/org.eclipse.ui.workbench/3.7.1.v20120104-1859/org.eclipse.ui.workbench-3.7.1.v20120104-1859.jar [ERROR] /opt/users/hudsonbuild/workspace/tycho-mat-nightly/trunk/plugins/org.eclipse.mat.dtfj/src/org/eclipse/mat/dtfj/DTFJPreferencePage.java:[17,0] [ERROR] import org.eclipse.ui.IWorkbenchPreferencePage; [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] Access restriction: The type IWorkbenchPreferencePage is not accessible due to restriction on classpath entry /opt/users/hudsonbuild/workspace/tycho-mat-nightly/.repository/p2/osgi/bundle/org.eclipse.ui.workbench/3.7.1.v20120104-1859/org.eclipse.ui.workbench-3.7.1.v20120104-1859.jar [ERROR] /opt/users/hudsonbuild/workspace/tycho-mat-nightly/trunk/plugins/org.eclipse.mat.dtfj/src/org/eclipse/mat/dtfj/DTFJPreferencePage.java:[30,0] [ERROR] public class DTFJPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] Access restriction: The type IWorkbenchPreferencePage is not accessible due to restriction on classpath entry /opt/users/hudsonbuild/workspace/tycho-mat-nightly/.repository/p2/osgi/bundle/org.eclipse.ui.workbench/3.7.1.v20120104-1859/org.eclipse.ui.workbench-3.7.1.v20120104-1859.jar [ERROR] /opt/users/hudsonbuild/workspace/tycho-mat-nightly/trunk/plugins/org.eclipse.mat.dtfj/src/org/eclipse/mat/dtfj/DTFJPreferencePage.java:[66,0] [ERROR] public void init(IWorkbench workbench) [ERROR] ^^^^^^^^^^ [ERROR] Access restriction: The type IWorkbench is not accessible due to restriction on classpath entry /opt/users/hudsonbuild/workspace/tycho-mat-nightly/.repository/p2/osgi/bundle/org.eclipse.ui.workbench/3.7.1.v20120104-1859/org.eclipse.ui.workbench-3.7.1.v20120104-1859.jar [ERROR] 4 problems (4 errors) [ERROR] -> [Help 1] [ERROR] which needed a split package declaration to fix. org.eclipse.ui;ui.workbench="split";resolution:=optional, What more do we need to do?
I don't think there is something more at the moment. I'll close the ticket. We could track further activities if needed in this ticket (reopen) or in new ones.