Overview
Bushel provides utility classes for Ant Ivy that allow a developer to use a directory of OSGi bundles as a dependency repository. It does this through a custom metadata parser that converts a MANIFEST.MF file into a valid ivy.xml. The aim is to assist IDE-free OSGi development and continuous integration best practice.
Current limitations are that Import-Package and Export-Package parameters in the manifest file are ignored, however Require-Bundle is honoured.
Example
The Bushel example bundle is based on the Eclipse PDE/New Plug-in Project/OSGi Simple LogService Example.
It includes all the Ant and Ivy scripts required to compile and run the bundle, and can be used as a template for your own project.
To use the Ant script, you must provide the path to the Eclipse home dir (the parent dir of the plugins/ dir) using -Declipse.home=/path/to/eclipse. It provides the following targets:
- ant compile - Compile your bundle using Ivy to generate the classpath.
- ant bundle - Package your bundle jar ready for deployment.
- ant run - Run your bundle in equinox in console mode. Try ss, or diag 2, or help, and then finally close, to exit.
TODO
- Import-Package/Export-Package support.
- Examples with other OSGi containers (Felix, Knoplerfish etc).
- Eclipse Update site support.
Check out the project Issues for more detail.
Usage
ivysettings.xml
<ivysettings>
<classpath file="${basedir}/lib/bushel-0.6.jar" />
<typedef name="osgi-parser" classname="com.googlecode.bushel.ivy.OsgiManifestParser" />
<typedef name="osgi-file" classname="com.googlecode.bushel.ivy.OsgiFileResolver" />
<typedef name="osgi-latest" classname="com.googlecode.bushel.ivy.OsgiLatestStrategy" />
<property name="rcp-repo.dir" value="/path/to/rcp/bundles" />
<settings defaultResolver="local-rcp-repo" defaultLatestStrategy="osgi-latest-revision" />
<caches default="localcache">
<cache name="localcache" basedir="${basedir}/.ivy/localcache">
<ttl duration="0d" />
</cache>
</caches>
<parsers>
<osgi-parser />
</parsers>
<resolvers>
<osgi-file name="local-rcp-repo" latest="osgi-latest-revision">
<ivy pattern="${rcp-repo.dir}/plugins/[organisation].[module]_[revision].jar" />
<artifact pattern="${rcp-repo.dir}/plugins/[organisation].[module]_[revision].jar" />
</osgi-file>
</resolvers>
<latest-strategies>
<osgi-latest name="osgi-latest-revision" />
</latest-strategies>
</ivysettings>ivy.xml
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="com.acme" module="helloworld" />
<configurations>
<conf name="default" visibility="public" />
</configurations>
<dependencies>
<dependency org="org.eclipse" name="osgi" rev="3.4.+"/>
<dependency org="org.eclipse" name="osgi.services" rev="3.1.+"/>
</dependencies>
</ivy-module>