Building MobiComp

From MobiComp

Jump to: navigation, search

Contents

Preliminaries

First, get a copy of the source code (project members only):

The following pages are essential reading for anyone building their own MobiComp components. They include links to all other key components.

Directory layout

After checking-out the code into a directory of your choice (see MobiComp Repository), there will be three top-level directories:

  • MobiComp This is the working directory for building and testing. It contains an Ant build.xml file, several scripts for testing components, and a src directory containing the file ContextMonitor.java.
  • lib Contains various jar, dll and other files needed for building and running MobiComp.
  • src The main source code directory containing separate common and platform-specific source trees.

The Ant build.xml file

The Ant build.xml file contains all necessary instructions to build existing MobiComp components for linux, Windows XP and Windows CE (PocketPC) platforms. It also includes the locations of almost all required libraries in the lib directory. The only exception is the JMF libraries. If you intend to build the JMF-based image tracker, edit the following line near the top of the file to indicate the location of your JMF lib directory:

<property name="jmflib" value="/usr/local/java/jmf/lib"/>

Ant targets

There are five main, and many minor, build targets in build.xml. The main targets include all necessary minor targets:

  • ant wince builds everything for Windows CE platforms.
  • ant windows builds everything except the JMF camera tracker for Windows XP platforms.
  • ant windowsjmf builds everything, including the JMF camera tracker for Windows XP platforms.
  • ant linux builds everything except the JMF camera tracker for linux platforms.
  • ant linuxjmf builds everything, including the JMF camera tracker for linux platforms.

Each of the above creates two directories, build which contains all class files, and dist which contains the context.jar file for the target platform. If these directories exist when the build target is invoked, they are removed and recreated.

Other general targets:

  • ant docs builds javadoc pages for everything in the org.mobicomp trees under a docs directory.
  • ant clean removes any build, dist and docs directories. This target should be run before committing any changes back into the repository.

The remaining targets each build a single component. When writing a new component, it is suggested that you

  • create a new target for the component, with depends="init,context"
  • test the build script and the component (see Running MobiComp)
  • when working satisfactorily, remove the depends from the new target and add the name of the new target to the depends list for each required main build target.