
Instructions for building SWars from it's source code.
Table of contents
SWars is supported for building on any UNIX-like (Linux, Solaris, MacOS X, and others) or Windows machines. Building on other platforms is unsupported, but as long as those platforms have a Java 2 SDK available for them, it should not be too hard.
A Java 2 Software Developemnt Kit (J2SDK) is required for SWars development. A J2SDK can usually be obtained from either Sun's Java website or from your operating system's vendor. Version 1.3 will work better than v1.2, but is not required.
Java 1.0 and 1.1 is not supported when building or running SWars.
The machine you are using to build SWars must understand either .bat or .sh scripts. Windows and possibly OS/2 machines understand .bat scripts. Any machine with bash, sh, or another generic bourne shell should understand .sh scripts. Machines with csh or derivatives will find their milage varying.
SWars uses the Apache Software Foundation's Ant to build it's source code and other items. Ant is a Java-based, platform-independent, make-like program which manages build dependencies and automates building of SWars from source. It also handles the generation of documentation and new releases, automagically.
Ant's equivalent to a Makefile is build.xml. This is an XML file which Ant uses to determine what needs to be made, and how to make it when Ant is invoked. Consult the Ant documentation on the Apache Jakarta website for more information about the syntax of this document.
The environment must be set up correctly for Ant to run, the two environmental variables, JAVA_HOME and PATH, must be set. JAVA_HOME must be set to the home directory of the J2SDK you are using to build SWars, and PATH must contain the J2SDK's binary directory.
To do this under UNIX, using Sun's (or a Sun-like) J2SDK which is installed in /usr/local, execute the following commands from the command line:
export JAVA_HOME=/usr/local/jdk1.2.2
export PATH=${JAVA_HOME}/bin:${PATH}
To do this under UNIX, using Sun's (or a Sun-like) J2SDK which is installed in c:\, execute the following commands from the command line:
set JAVA_HOME=c:\jdk1.2.2
set PATH=%JAVA_HOME%\bin;%PATH%;
This only needs to be done once for each command line you use to build SWars, at the start before trying to build anything.
To invoke Ant on a UNIX machine, or a machine with a UNIX-like borne shell, use the following command from the command line, in the root SWars directory.
./build.sh [options] [target [target2 [target3] ...]]
In some cases, you may need to prefix the command with the name of your shell, like so:
sh ./build.sh [options] [target [target2 [target3] ...]]
To invoke Ant on a Windows machine, or a machine which understands Windows batch scripts, use the following command from the command line, in the root SWars directory.
build.bat [options] [target [target2 [target3] ...]]
The optional target arguments can be used to specify which targets Ant will be run on. If no target is specified, the default will be used. See the Ant documentation for a list of options, but one useful option is -projecthelp, which lists all of the project's targets.
This is a list of the commonly used SWars targets:
For example, to build the editor under UNIX, you would enter:
./build.sh editor