Development Guide
Source Layout
dfc/ DSTO Foundation Classes
...
livespaces/ Livespaces components
livespace.build/ Builds Livespace source
build Script to build from source
distro Script to build distributions
dist/ Distribution files built here
...
livespace.osgi/ Livespace OSGi runtime host
lib/bundles/ Livespace OSGi bundles built here
bin/start_livespace Shell script to launch Livespaces/OSGi
config/ Livespace service configurations
...
...
Most of the Livespace components (livespace.* directories under
livespaces) correspond to an OSGi bundle of the same name that is
built and deployed into livespaces.osgi/lib/bundles by a ‘bundle’
target in the component’s Ant build.xml file.
The livespace.build project contains scripts to coordinate building
all Livespace and DFC components and generating distribution packages.
The livespaces.osgi project contains an OSGi runtime
(Knopflerfish) plus scripts and bootstrap code needed
to configure and launch a Livespaces runtime (server or client).
Requirements
Java Development Kit (JDK), 1.5 or later.
Supported platforms: Microsoft Windows (XP or later), Mac OS X (10.4 or later), Linux (we test on Fedora and Ubuntu), Solaris (5.9 and later). A very few components have more limited platform requirements, including Livepoint (currently Windows, Mac OS X and Linux only) and the Meta Applications PowerPoint control (Windows only due to use of OLE Automation to drive PowerPoint).
The Livespaces GUI components are built on SWT, which requires a native libary built for each platform. Pre-packaged SWT libraries are included for the common platforms: Microsoft Windows (x86, 32 bit), Mac OS X (Universal PPC and i386 32 bit and x86_64 64 bit), Linux (x86, 32 and 64 bit) and Solaris (SPARC).
Optional:
Unix Bourne shell environment. Where possible both Bourne shell scripts and DOS batch files are provided, but several useful utilities are only available as shell scripts. It is recommended for Windows development that you install Cygwin and run from the included bash shell environment.
Eclipse (3.3 or later). The Livespace projects include Eclipse project information to enable you to import and compile the Livespaces projects from the Eclipse IDE.
Getting Started
The examples below assume a Bourne shell command line environment.
Build all projects:
$ cd livespaces/livespace.build $ ./build
Run Livespaces inside the included OSGi runtime (assumes you’ve created a configuration called
my_room— see the installation documentation for how to do this):$ cd livespaces/livespace.osgi $ export LIVESPACE_OSGI_PATH="file:$PWD" $ export LIVESPACE_CONFIG="my_room" $ ./bin/start_livespaces
Build source distributions:
$ cd livespaces/livespace.build $ ./distro
Using Eclipse
To import into Eclipse (3.3 or later):
Choose ‘File → Import → Existing Projects Into Workspace’.
Select the directory that you extracted Livespaces to. You should see a number of projects prefixed by ‘dfc.’ and ‘livespace.’ — import all of these.
dfc.swtwill not compile until you choose the version of SWT for your platform (sorry, we haven’t been able to find a way to select this automatically).Select the
dfc.swtproject in the workspace. Choose ‘File → Properties’, then ‘Java Build Path’, then the ‘Libraries’ tab.Double-click the ‘DFC SWT’ user library.
Click ‘User Libraries’ in the dialog that appears.
Double click
swt.jarand select the version of SWT for your platform:
| Windows: | dfc.swt/lib/swt/win32/swt.jar |
| Mac OS X (10.4 - 10.5): | dfc.swt/lib/swt/cocoa_i386_ppc/swt.jar |
| Mac OS X (10.6): | dfc.swt/lib/swt/cocoa_x86_64/swt.jar |
| Linux (x86): | dfc.swt/lib/swt/gtk_linux_x86/swt.jar |
| Linux (x86-64): | dfc.swt/lib/swt/gtk_linux_x86_64/swt.jar |
To run build and distribution targets from inside Eclipse:
- Select
livespace.buildorlivespace.distrofrom the ‘Run → External Tools’ menu. These are equivalent to runninglivespace.build/buildandlivespace.build/distrofrom the command line.
Where To From Here?
Have a look at the livespace.services.clipboard and
livespace.ui.clipboard projects for a really simple example of a
Livespace service and its associated Dashboard GUI widget.
The build.xml file in each project demonstrates how to build the
associated OSGi bundle for each component and deploy it into the
bundle staging area in livespace.osgi.