Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Equinox Transforms

Revision as of 12:26, 22 February 2008 by Unnamed Poltroon (Talk) (Updated to new bundle formats)

Projects exist in the equinox incubator that allow you to provide transformations of bundle resources at the OSGi level. Various example transformers exist (XSLT, sed, replacement) that can be used to transform any resource in a bundle including but not limited to plugin.xml, MANIFEST.MF, class files, etc.

How To Run The Examples

  1. Download Eclipse 3.2.1 or any subsequent release. This code has been tested with 3.2.1, 3.3.2, and numerous 3.4 milestones up to and including M5.
  2. Check out the following projects from site :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse folder equinox-incubator:
    • org.eclipse.equinox.transforms.hook
    • org.eclipse.equinox.transforms.util
    • org.eclipse.equinox.transforms.replace
    • org.eclipse.equinox.transforms.replace.images
    • org.eclipse.equinox.transforms.sed
    • org.eclipse.equinox.transforms.sed.manifest
    • org.eclipse.equinox.transforms.xslt
    • org.eclipse.equinox.transforms.xslt.plugin
  3. Check out org.eclipse.osgi from :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse/ (see bug 143696 for why this is necessary)
  4. From the Run menu, choose Run
  5. locate the example launch you wish to run and run it. They are named Replacement Transform Launch, Sed Transform Launch, and XSLT Transform Launch. Please note that the Sed launch will not work if you do not have the sed program available on your path. Please also note that the serialization of launches between different versions of Eclipse and between workspaces on varying OS platforms can sometimes be problematic. You may need to go to the Plug-Ins tab in the launch configuration and choose "Add Required Plug-Ins" to ensure that you have all of the required bundles.

How To Package Transformers for Distribution

Very rough ATM.

The transformer bundles work via adaptor hooks. As such, they are framework extensions and follow slightly different rules than other bundles. For full documentation on how to use adaptor hooks in your application please see Adaptor Hooks.

  1. ensure that all bundles required for the desired transformations are available. This means typically means org.eclipse.equinox.transforms.hook , the bundle implementing the desired transform type (ie: org.eclipse.equinox.transforms.xslt), and the bundle that provides the transformation file(s) (ie: org.eclipse.equinox.transforms.plugin).
  2. create (either from scratch or by copying one from your existing product configuration) a config.ini file that has your both the bundle inplmenting the transformer type (ie: org.eclipse.equinox.transforms.xslt) as well as the bundle containing your particular transforms (ie: org.eclipse.equinox.transforms.plugin) listed on the osgi.bundles line with an eager start level. Ie: org.eclipse.equinox.transforms.xslt@1:\start, org.eclipse.equinox.transforms.xslt.plugin@1:\start. See the config.ini in org.eclipse.equinox.transforms.xslt.plugin for an example.
  3. ensure that the org.eclipse.equinox.transforms.hook bundle is expressed as framework extension bundle via the osgi.framework.extensions property in the config.ini file. Ie: osgi.framework.extensions=org.eclipse.equinox.transforms.hook

How To Write Your Own Transformer

TBD

Back to the top