Index: build_lib/bnd-0.0.249.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: build_lib/bnd-0.0.249.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Index: build.xml
===================================================================
--- build.xml	(revision 7386)
+++ build.xml	(working copy)
@@ -217,7 +217,7 @@
           </and>
       </condition>
       <antcall target="_jarjar_internal_"/>
-      
+            
       <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="${build.lib.dir}/jarjar-1.0rc7.jar"/>
       <jarjar destfile="${lib.dir}/jruby.jar" compress="false">
         <fileset dir="${jruby.classes.dir}"/>
@@ -228,7 +228,21 @@
         </manifest>
         <rule pattern="org.objectweb.asm.**" result="jruby.objectweb.asm.@1"/>
       </jarjar>
+      <antcall target="_osgify-jruby_" />
   </target>
+
+  <!-- Use Bnd to wrap the JAR generated by jarjar in above task -->
+  <target name="_osgify-jruby_">
+    <filter token="JRUBY_VERSION" value="${version.jruby}"/>
+    <copy file="${basedir}/jruby.bnd.template" tofile="${build.dir}/jruby.bnd" filtering="true"/>
+    <taskdef resource="aQute/bnd/ant/taskdef.properties"
+      classpath="${build.lib.dir}/bnd-0.0.249.jar"/>
+    <bndwrap definitions="${build.dir}" output="${lib.dir}">
+      <fileset file="${lib.dir}/jruby.jar" />
+    </bndwrap>
+    <move file="${lib.dir}/jruby.jar$" tofile="${lib.dir}/jruby.jar" 
+      overwrite="true" />
+  </target>
   
   <target name="_jarjar_internal_" unless="jarjar.uptodate">
     <jar destfile="${jarjar.deps.jar}">
Index: jruby.bnd.template
===================================================================
--- jruby.bnd.template	(revision 0)
+++ jruby.bnd.template	(revision 0)
@@ -0,0 +1,6 @@
+Export-Package: org.jruby.*;version="@JRUBY_VERSION@"
+Import-Package: !org.jruby.*, *;resolution:=optional
+Bundle-Version: @JRUBY_VERSION@
+Bundle-Description: JRuby @JRUBY_VERSION@ OSGi bundle
+Bundle-Name: JRuby @JRUBY_VERSION@
+Bundle-SymbolicName: org.jruby.jruby

