Overview
The root directory of your Sedona Framework installation is referred to as Sedona home. Relative directories specified by this documentation are assumed relative to the Sedona home directory. Sedona home is organized into the following sub directories:
- adm: administration scripts used to build and test
- apps: application files (.sab and .sax files)
- bin: win32 binaries and Unix shell scripts
- doc: documentation
- kits: standard directory used to store kit files
- lib: Java jar files and properties files
- manifests: directory for manifest database
- platforms: Contains source files used to stage Sedona Framework platforms, and also contains the platform database.
- scode: files related to linking scode images
- src: directory tree for Java, C, and Sedona source code
Sedonac
Windows
Sedona Framework development primarily centers around the "bin/sedonac.exe" executable. If using the command line, you probably want to ensure that bin is in your path.
The compiler requires a Java Runtime of 1.4 or greater. The "sedonac.exe" launch executable will look in the registry to find where your current VM is installed. If you need to debug the launcher you can run "sedonac --v" (that's two dashes before the 'v'), which will trace the registry access and jvm.dll load.
To verify sedonac is correctly installed, run with the "-ver" option:
D:\sedona\pub\src>sedonac -ver Sedona Compiler 1.0.35 Copyright (c) 2007-2009 Tridium, Inc. sedona.version = 1.0.35 sedona.home = D:\sedona\pub java.home = C:\Program Files\Java\jre1.6.0_05 java.version = 1.6.0_05
Unix
There is a bash shell script in "adm/unix" that you can use and modify to initialize your Sedona Framework development environment. It is called init.sh. In order to use this script, you must first
- export JAVA_HOME in your login script.
- create a symbolic link in your home directory called "sedonadev" that
points to your actual Sedona home directory. For example,
~/sedonadev -> ~/repos/sedona-1.0/pub
If you don't want to use this symbolic link, edit init.sh to explicitly set the sedona_home environment variable.
After doing the above configuration, change your login script to run "init.sh". This script will make sure some key programs are in your PATH, make sure that all the python scripts have executable permissions, and create some useful aliases.
There are two UNIX specific commands that you should use for building in a UNIX environment
- makeunixvm.py: compile the unix svm using gcc. Run makeunixvm -h for more details
- makeunixdev.py: Builds sedona.jar, sedonac.jar, all opensource kits, and makes the unix svm.
Java Command Line
If you need to invoke Sedonac directly you can launch it directly with Java:
- Put lib/sedona.jar and lib/sedonac.jar in your classpath
- Pass the installation directory to the "sedona.home" system property
- Run the "sedonac.Main" class
For example:
java -cp {lib}sedona.jar;{lib}sedonac.jar -Dsedona.home={home} sedonac.Main
Environment
You can rebuild from source using the python scripts in the adm directory. These scripts are used to rebuild the compiler itself and the SVM. In order to use the python scripts, you will need to install Python (version 2.7 or better). Also the following environment variables must be defined:
- sedona_home: directory of your Sedona Framework installation (the parent directory of adm, bin, lib, etc).
- java_home: directory of the Java JDK (1.4 or later). Java code is compiled with "adm/jikes.exe", but the JDK is used for "bin/jar.exe" and "jre/lib/rt.jar".
- win_sdk: if you wish to compile the VM using the Visual Studio C compiler then "win_sdk" should reference your Windows development kit. Also make sure you have run the "vcvars32.bat" script included in your Visual Studio installation. If you aren't going to recompile the SVM for Win32, then this setup is unnecessary.
To verify your environment you can run the "adm/env.py" script, which will print all the files and directories being used with your current setup.
Common Commands
The following commands are commonly used when building and running the Sedona Framework:
- makesedona.py: compile sedona runtime Java source into sedona.jar
- makesedonac.py: compile sedonac Java source into sedonac.jar (depends on sedona.jar)
- makewinvm.py: recompile svm.exe for Win32 using Visual Studio compiler
- sedonac src\foo: compile Sedona source for kit foo into foo.kit
- sedonac scode\foo.xml: link Sedona kits specified by foo.xml into foo.scode image file
- sedonac apps\bar.sax: compile a SAX file into a SAB file
- svm scode\foo.scode apps\bar.sab: run win32 SVM with the specified scode and app file
- svm scode\foo.scode -test: run test suite with the win32 SVM and the specified scode file
- svm --plat:
For the open source win32 and unix svm implementations, this allows you to run the svm in "platform mode". Running in platform mode allows the svm to handle restart commands, and it will handle loading staged scode and sab files. The svm must be running in platform mode to pass the certification test suite. See the svm usage for more details. - jsvm apps\bar.sab: run Sedona Framework application on the Java VM with the specified app file
- makedev.py: recompile all the commonly used targets and run tests with the win32 svm
Note that any command that builds the SVM will need to have the appropriate target toolchain set up first.