Home > buildr-ipojo

buildr-ipojo

Buildr-ipojo is a project mainly written in Ruby, based on the Apache-2.0 license.

A Buildr extension for processing OSGi bundles using IPojo

= iPojo support for buildr

iPojo is an OSGi component model (http://felix.apache.org/site/apache-felix-ipojo.html). This extension processes OSGi bundles using iPojo's pojoizer to generate the required metadata for the iPojo component model.

The extension will process all packages of type :jar and generate the required metadata from annotations and an ipojo metadata file if present. The default location of the metadata file is "src/main/config/ipojo.xml" but this can be changed by assigning the "ipojo.metadata_filename" setting.

A typical project that uses the extension with the default metadata file location.

define 'myProject' do ... project.ipojoize! package :jar ... end

An example of a project that specifies the metadata file location.

define 'myProject' do ...

Note: no longer require project.pojoize!

project.ipojo.metadata_filename = _("src/ipojo.xml")
package :jar
...

end

Note: Often projects that are building OSGi bundles will make use of the buildr-bnd extension available at http://github.com/realityforge/buildr-bnd

An example of a project that makes use of both buildr-ipojo and buildr-bnd extensions to build an OSGi bundle is;

gem 'buildr-bnd' gem 'buildr-ipojo'

require 'buildr_bnd' require 'buildr_ipojo'

repositories.remote << Buildr::Bnd.remote_repository repositories.remote << Buildr::Ipojo.remote_repository

desc 'My bundle project' define 'myProject' do project.version = '0.1.1-SNAPSHOT' project.group = 'mygroup'

compile.with Buildr::Ipojo.annotation_artifact
project.ipojoize!

package(:bundle).tap do |bnd|
  bnd['Export-Package'] = "mygroup.*;version=#{version}"
end

end

== Installation

The extension is packaged as a gem named "buildr-ipojo", consult the ruby gems installation steps but typically it is either

sudo gem install buildr-ipojo

for MRI ruby or

jgem install buildr-ipojo

for jruby.

The user then needs to add the following require into the build file:

require 'buildr_ipojo'

If the local maven repository does not contain the required ipojo jars they can be downloaded but you will need to register the remote repository by adding the following to the build file:

repositories.remote << Buildr::Ipojo.remote_repository

Previous:newdel