OSGi is getting more and more popular these days. Thus shipping an OSGi-fied version of dnsjava along with the regular Jar simplifies adoption in OSGi projects. This patch adds a "bundle" target to the ANT build, that does exactly this.
Would it be possible for you to create a (2.0.8 and/or HEAD) bundle and distributed it via sf.net? Would make my build integration into ECF a lot easier. Thx
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There will be a new release sometime soon (in the next week or two), but the sf release process is painful enough that doing releases on demand isn't realistic.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Adds a "bundle" target to ANT build
FYI I intent to consume dnsjava to implement a DNS-SD based discovery provider [0] for ECF (Eclipse Communication Framework).
[0] https://bugs.eclipse.org/bugs/show_bug.cgi?id=310580
I don't have any opinion on OSGi, but this looks mostly self contained. Unfortunately, attempting to run the bundle target results in:
[bndwrap] Warnings
[bndwrap] Superfluous export-package instructions: [org, org.xbill]
I have no idea what this means, but I'm not going to commit a patch that adds warnings.
Fair enough, I will address the warning with an updated patch .
Here's the revised patch. Unfortunately I can't find a way to update the original patch. Hope it's usable nonetheless.
### Eclipse Workspace Patch 1.0
#P dnsjava
Index: build.xml
===================================================================
--- build.xml (revision 1610)
+++ build.xml (working copy)
@@ -44,11 +44,30 @@
</metainf>
</jar>
</target>
+
+ <target name="bundle" description="Creates an OSGi bundle" depends="jar">
+ <get src="http://www.aqute.biz/repo/biz/aQute/bnd/0.0.384/bnd-0.0.384.jar"
+ dest="${build_dir}/bnd.jar"/>
+ <taskdef resource="aQute/bnd/ant/taskdef.properties"
+ classpath="${build_dir}/bnd.jar"/>
+ <echo file="${dist_dir}/dnsjava-${version}.bnd" append="false">
+ Bundle-Version: ${version}
+ Bundle-Name: dnsjava is an implementation of DNS in Java
+ Bundle-SymbolicName: org.xbill.dns
+ Export-Package: org.xbill.DNS;uses:="org.xbill.DNS.utils",org.xbill.DNS.spi;uses:="org.xbill.DNS,sun.net.spi.nameservice",org.xbill.DNS.utils,org.xbill.DNS.windows
+ Bundle-Vendor: Brian Wellington
+ Bundle-RequiredExecutionEnvironment: J2SE-1.4
+ </echo>
+ <bndwrap
+ definitions="${dist_dir}"
+ jars="${dist_dir}/${jarname}"
+ output="${dist_dir}/org.xbill.dns_${version}.jar"/>
+ </target>
<target name="clean" description="Remove old class files">
<delete>
<fileset dir="${build_dir}" includes="**/*.class"/>
- <fileset dir="${build_dir}" includes="*.jar *.zip *.tar.gz jcoverage.ser"/>
+ <fileset dir="${build_dir}" includes="*.bnd *.jar *.zip *.tar.gz jcoverage.ser"/>
</delete>
</target>
Committed, with a minor change replacing my name with dnsjava.org in Bundle-Vendor.
Thanks for applying the fix.
Would it be possible for you to create a (2.0.8 and/or HEAD) bundle and distributed it via sf.net? Would make my build integration into ECF a lot easier. Thx
There will be a new release sometime soon (in the next week or two), but the sf release process is painful enough that doing releases on demand isn't realistic.
Ticket moved from /p/dnsjava/patches/17/