Java Reference
In-Depth Information
bnd Ant
task
Ant
Code-
rst
Begin
project
Maven
or Ant?
Maven
bundle plug-in
Maven
eba plug-in
rst or
code-first?
Maven
Manifest-
rst
Maven
Maven
or Ant?
Maven
Tycho plug-in
Maven
eba plug-in
Ant
Figure 8.1 What build tools are right for you
can be decided by whether you want to control
your manifests or not, and which build tools you
already prefer.
PDE
build
osgijc
Roll your
own
one of the many tools that incorporate bnd under the covers. For this reason, it's
important to understand what bnd is and what it can do for you. Bnd analyzes a bun-
dle's bytecode to work out what packages it would need to import to work properly, and
then it uses that information to generate a manifest. Bnd is extremely powerful and
could easily fill a chapter of its own. In this chapter, we'll cover the bits of bnd you're
most likely to use at build time, but we'll come back to some of bnd's other features
again in section 12.1.3.
Why are we only getting to bnd at this late stage?
The bnd tool is widely used for OSGi development; some people argue that OSGi
development on any kind of serious scale is impossible without bnd, and will be won-
dering why we've waited so long to introduce bnd. In our view, using bnd is like using
a calculator. When you learn addition and multiplication in school, you don't use a
calculator, because it's important to properly understand the basic principles; after
you've got the basics mastered and move on to more advanced math, you use a cal-
culator to handle the basics for you. In our opinion, even if you opt for a code-first
style of development, you must understand OSGi manifests so that you can under-
stand what the tools have generated for you.
BUILDING WITH BND
Bnd works from a configuration file that it uses to guide the generation of your mani-
fest. Simple .bnd files are almost indistinguishable from MANIFEST.MF files. Let's have
a look at the bnd file for the fancyfoods.persistence bundle in the next listing.
 
Search WWH ::




Custom Search