Building and running Omarj

The following should help you build and run Omarj.


Required Software

You must already have JDK1.3 on your machine. Make sure you can run the commands java and javac from your shell by just typing their names.


Building Omarj

We use a Scheme based Java scripting language called JScheme, (formerly known as SILK) in order to build and run ScoreJ. JScheme is provided with the relese in the bin directory. Below are some simple commands for creating the javadocs, compiling the ScoreJ, and running the tests. The following section describs the scripting language in more detail.

These following bin\build commands should all be executed from the root omarj directory

Bootstrapping

While a Java application is portable, building the application is not portable because of differences between shells on different operating systems. To get around this problem we use SILK, see http://silk.sourceforge.net, a portable Java scripting language. SILK programs look like Scheme with some Java extensions.

The command bin/build can be used to run various build operations on Omarj. This script does two things. First, it runs a bootstrap script:


java -jar lib/silk.jar src/scm/bootstrap.scm 

This constructs two files: bin/silk.bat or an bin/silk file depending on your machine type. The result is a one line script that is very specific to your machine. This script can be run from any directory. It should be used to invoke Omarj components.

The second thing that bin/build does is invoke the constructed script with your arguments.

Command line arguments

To see what command bin/build will currently take, run the command:


bin/build -help

This should produce something like this:


build command*

With no commands, a GUI is displayed (not yet).
command ::= -key arg*

Where command is one of:

-cvs       = Update sources from CVS.
-clean     = Remove all class files.
-aspectj   = aspectj + javac.
-javac     = Compile using javac.
-javadoc   = Build javadoc.
-jinigui   = Jini control gui.
-junit class*     = JUnit test gui.
  The default class is scorej.tests.STestSuite.
-main class args* = Invoke class.main(args).
-nightly   = Do a nightly build.
-help      = Print this message.

So for example, to update the sources, a clean recompile and run the standard tests do:


bin/build -cvs
bin/build -clean -javac -junit
	      

The -cvs step need only be done separately if new lib/*.jar files are added.


Invoking Omarj commands

The silk command can be invoked like this:


  java silk.Scheme [-s][-j] [(s-expr)] [file] ... [-main procedure arg1 ...]

Where: 
  -s   
    Use normal Scheme syntax for numbers and characters.

  -j   
    Use Javalike syntax for numbers and characters.

  (s-exp)  
    An argument that begins with "(" is evaluated.

  -main procedure arg1 ...
    Rather than starting the normal Scheme.main, 
    collect arg1 ... into a String[] and apply procedure to it.
    If procedure is none, no main is started.

So, for example, to run a JUnit test in batch mode:

bin\silk -main scorej.tests.STestSuite.main

To start the JINI launch service:

bin\silk -main com.sun.jini.example.launcher.StartService.main

Interacting with Omarj components in Emacs

You can also run SILK from an EMACS buffer, which makes things much easier. Tailor your .emacs environment to include a version of emacs/scheme-init.el edited for your machine.