Compilation Guide
In this section, we describe how to compile all the sources and create the bundles jar files.
Requirements
You have to download the sources containing also the file build.xml. You also need the Java-based build tool called ant. You can find it here.
As our program includes native code, you need the gcc compiler.
You'll also need some other archives : osgi-svc.jar and javax.servlet.jar. Download osgi-svc.jar here and place it in your oscar/lib directory. Then download servlet.jar and unjar it to get javax.servlet.jar that you copy to your oscar/lib directory.
You also need the cpptask.jar from ant-contrib. That service is used to compile native code in the drivers.
How to compile
First you should go in the root directory of the project where is placed the build.xml (in our case /opt/osgidev).
Then enter the command ant:
[root@Awap osgidev]# ant
Buildfile: build.xml
init:
logger:
[javac] Compiling 1 source file to /opt/osgidev/classes
[jar] Building jar: /opt/osgidev/bundles/logger.jar
httpresources:
[javac] Compiling 1 source file to /opt/osgidev/classes
[jar] Building jar: /opt/osgidev/bundles/httpresources.jar
devicemanager:
[javac] Compiling 3 source files to /opt/osgidev/classes
[jar] Building jar: /opt/osgidev/bundles/devicemanager.jar
driverlocator:
[javac] Compiling 2 source files to /opt/osgidev/classes
[jar] Building jar: /opt/osgidev/bundles/driverlocator.jar
modulemanager:
[javac] Compiling 3 source files to /opt/osgidev/classes
[jar] Building jar: /opt/osgidev/bundles/modulemanager.jar
core:
pcmciadevice:
[javac] Compiling 5 source files to /opt/osgidev/classes
[jar] Building jar: /opt/osgidev/devices/pcmciadevice.jar
pcmciadriver:
[javac] Compiling 5 source files to /opt/osgidev/classes
[copy] Copying 8 files to /opt/osgidev/classes/native
[jar] Building jar: /opt/osgidev/devices/pcmciadriver.jar
wlandriver:
[javac] Compiling 1 source file to /opt/osgidev/classes
[copy] Copying 1 file to /opt/osgidev/classes/native
[jar] Building jar: /opt/osgidev/devices/wlandriver.jar
samples:
wlandrivertest:
[javac] Compiling 1 source file to /opt/osgidev/classes
[jar] Building jar: /opt/osgidev/bundles/wlandrivertest.jar
tools:
all:
BUILD SUCCESSFUL
Total time: 31 seconds
If you want more detail use the option -v (vrebose).
Before recompiling, you need to clean the sources from what has been generated before.
Use ant clear:
[root@Awap osgidev]# ant clear
Buildfile: build.xml
clear:
[delete] Deleting 55 files from /opt/osgidev/classes
[delete] Deleted 20 directories from /opt/osgidev/classes
[delete] Deleting 6 files from /opt/osgidev/bundles
[delete] Deleted 1 directory from /opt/osgidev/bundles
[delete] Deleting 3 files from /opt/osgidev/devices
[mkdir] Created dir: /opt/osgidev/classes
[mkdir] Created dir: /opt/osgidev/bundles
BUILD SUCCESSFUL
Total time: 2 seconds