r1 - 20 Mar 2006 - 03:28:00 - VikOlliverYou are here: SuperWaba >  Codev Web  > LinuxDevelopmentEnvironment

Introduction

Establishing a SuperWaba development environment under Linux is a rather easy task. All the tools necessary for SuperWaba development are available in the SuperWaba SDK which can be downloaded from http://www.superwaba.com.br

Superwaba installation

Once the package is obtained, it needs to be unzipped.

Unzip the package

unzip superWabaSDK.zip

Once the SDK is extracted, it needs to be placed in a useful location . We will assume the environment is being established for a single user, in which case anywhere in the user's home directory is acceptable.

Move SDK to home locale

mv superWabaSDK ~/any location

Once the SDK is in its desired location one must set the Java classpath environment variable to include the new library. In a single user environment, a personal start-up script can be used for this purpose, such as ~/.bash_profile which is provided by any Linux system that gives its users a Bash shell by default. You can temporarily define the classpath variable in a shell, but it is much more useful to define it permanently in the above file. In any case, the following must be defined somewhere on the system:

CLASSPATH="{full path to the SDK}/lib/SuperWaba.jar:{full path to SDK}/utils:."

The classes directory holds the SuperWaba class files. The bin directory holds tools that will be used during compilation. If a classpath variable is already defined on the system, then the above path can be appended to the variable with the same syntax. Also, note the last ':.', this is necessary to include the current working directory in the classpath. Without this addition, compilation will fail. In order for the new classpath variable to take effect, the shell or X window environment being worked in must be exited and the system logged back into.

Superwaba example

With the SuperWaba SDK in place and the classpath properly defined, one can begin developing SuperWaba applications. We will assume the reader has already written a SuperWaba program called MySuperWabaApp?.java . In order to test/run this program either on a Palm OS device or POSE, we must transform the .java source code into a Palm OS executable .prc file. This can be accomplished in a few easy steps:

Change to the directory with the SuperWaba source

cd {path to SuperWaba source}

Compile source

javac MySuperWabaApp.java

Run Warp on the newly created .class files

java Warp c MySuperWabaApp MySuperWabaApp.class

Run Exegen on the .class files

java Exegen MySuperWabaApp MySuperWabaApp MySuperWabaApp

Warp is a java program found in {full path to SDK}/utils. Warp's purpose is to create the .pdb files used by Palm OS applications and the .wrp files used by Windows CE devices. We are only concerned with the .pdb file. The first argument to Warp, c, tells the program to create a .pdb file. The second argument is the name of the to-be-created .pdb file, and the third argument is all of the .class program files.

Exegen is a java program that can also be found in same directory as Warp. Exegen's purpose is to create the .prc file, which is the SuperWaba program in Palm OS executable form. The first argument to Exegen is the name of the to-be-created .prc file. The second argument is the name of the main source code file. The third argument is the name of the .wrp file.

If the above steps were successful, then a ready-to-use/test Palm OS application should be in the current directory. There should be files called MySuperWabaApp.prc and MySuperWabaApp.pdb . Both of these files, along with the SuperWaba virtual machine files, must be installed on a Palm unit or POSE in order to run the application. The SuperWaba virtual machine files can be found in {full path to the SDK}/lib . Of course, the above command line arguments can be tedious to type over and over again while developing. Therefore, it is much nicer to place all of the commands in a simple shell script, like this Bash script, so everything can be easily run in sequence with a single command ./superwaba_maker.sh:

#!/bin/bash
# Example build script for a Chess Clock application
echo "Compiling ChessClock source..."; echo ""
javac ChessClock.java
echo "Running ChessClock.class through Warp..."; echo ""
java Warp c ChessClock ChessClock.class Clock.class
echo ""; echo "Running ChessClock through Exegen..."; echo ""
java Exegen ChessClock ChessClock ChessClock
echo ""; echo "Cleaning up..."; echo ""
rm *.lnk *.wrp
echo "Finished!"; echo ""

Don't forget to use chmod +x ./superwaba_maker.sh to make it executable first, or you won't be able to run it.

-- VikOlliver - 20 Mar 2006

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
SuperWaba home
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding SuperWaba? Send feedback