The current integration now relies on the Eclipse 3.3 SWT provided Mozilla browser widget (style SWT.MOZILLA). This widget depends on having Xulrunner installed.
ATF provides an extension point that can load a contributed Xulrunner (packaged as a plugin) and make it known to SWT. This private xulrunner makes the overall installation of ATF easier, and guarantees that we are using the correct version.
Mozilla.org provides Xulrunners for MacOS, Win32 and Linux/GTK/32 as well as the Java XPCOM interfaces packaged as plugins: ftp://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/22.214.171.124/contrib/eclipse
The three Xulrunners plugins depend on ATF and extend the ATF extension point.
In their manifest you will find:
And they extend:
<extension id="org.mozilla.xulrunner.win32.win32.x86" name="Mozilla Xulrunner for Windows" point="org.eclipse.atf.mozilla.ide.core.xulrunner"> <xulrunner path="/xulrunner" version="126.96.36.199"/> </extension>
This extension ultimately help set a system property org.eclipse.swt.browser.XULRunnerPath that SWT can rely on to find a Xulrunner installation.... ;-)
On the ATF side org.eclipse.atf.mozilla.ide.core exposes the extension point and provide utilities code to deal with Xulrunner interactions. It also exposes a dependecy on org.eclipse.atf.core.
Problems with the Current integration
The problems with this layout is that the Mozilla Xulrunner bundles depend on ATF @ Eclipse, and cannot be consumed without ATF org.eclipse.atf.mozilla.ide.core and org.eclipse.atf.core. atf.core depends on the core platform and WTP/WST core. Very quickly any user of the Mozilla bundles will require to pull in tons of dependencies.
To get a more flexible and modular layout, the following layout is suggested:
- remove dependencies in org.eclipse.atf.mozilla.ide.core on anything but the core Eclipse platform:
- move the class org.eclipse.atf.mozilla.ide.core.util.SourceLocatorUtil.java to the bundle: org.eclipse.atf.core where it should be. This will impact org.eclipse.atf.mozilla.ide.debug, org.eclipse.atf.mozilla.ide.debug.ui and org.eclipse.atf.mozilla.ide.ui. debug already has a dependency on org.eclipse.atf.core. It would have to be added for debug.ui and ide.ui.. or we could extract that in a separate utility bundle for mozilla.ide consumption only. (BTW, the class org.eclipse.atf.mozilla.ide.core.util.SourceLocatorUtil is a singleton, but maintains no state. I would suggest to make all methods static instead. )
- remove the dependency on org.eclipse.atf.core
- Change the extension point org.eclipse.atf.mozilla.ide.core.xulrunner such that we add a bundle id attribute. The new extension example from above would look like:
<extension id="org.mozilla.xulrunner.win32.win32.x86" name="Mozilla Xulrunner for Windows" point="org.eclipse.atf.mozilla.ide.core.xulrunner"> <xulrunner bundle="org.mozilla.myxulrunner.win32.win32.x86" path="/xulrunner" version="188.8.131.52"/> </extension>
In that example, the extension point code would look into the the bundle org.mozilla.myxulrunner.win32.win32.x86 at path /xulrunner to look for a Xulrunner version 184.108.40.206.
(NB: we could aslo add expression support to put filters on OS/ACH/WS/NL, but that would be overkill as we already have the EclipsePlatformFilter directive for that.)
- Create three new bundles @ Atf, one for each platform (win,lin,mac). Their MANIFEST.MF would be something like:
Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Mozilla Xulrunner Bundle-SymbolicName: org.eclipse.atf.xulrunner.win32.win32.x86;singleton:=true Bundle-Version: 220.127.116.11-20070404 Bundle-Localization: plugin Bundle-ClassPath: . Eclipse-PlatformFilter: (& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86) ) Require-Bundle: org.eclipse.atf.mozilla.ide.core, org.mozilla.xulrunner.win32.win32.x86
(NB: the platform filter would be optional, as it already exist in org.mozilla.xulrunner.win32.win32.x86 , but I think it is better to express it also here so we are in control)
Their plugin.xml would be like that:
<extension id="org.mozilla.xulrunner.win32.win32.x86" name="Mozilla Xulrunner for Windows" point="org.eclipse.atf.mozilla.ide.core.xulrunner"> <xulrunner bundle="org.eclipse.atf.xulrunner.win32.win32.x86" path="/xulrunner" version="18.104.22.168"/> </extension>
By working with the Mozilla folks, on each of the three xulrunner bundles (win,lin,mac) , remove the
Require-Bundle: org.eclipse.atf.mozilla.ide.core <code> directive from the bundles manifests. and Remove the plugin.xml
Benefits of the proposed rearchitecture
- Mozilla provided budnles do not depend on ATF and can be consumed standalone
- org.eclipse.atf.mozilla.ide.core does not have dependencies on the rest of ATF. The org.eclipse.atf.mozilla.ide.core and the Mozilla bundles can be used in tandem by adopters which would want to use only this subset of ATF.
- ATF can control exatcly which Mozilla Xulrunner bundles version it consumes (today the control is split between ATF and Mozilla)