Build / Release System:
SquirreL SQL Client is written in Java, so it is only natural that it's build mechanism is also platform-independent. The Apache foundation's “Ant” (http://ant.apache.org/) build tool is used to build the code from source and turn the result into a java installer archive (with help from IzPack – see http://www.izforge.com/izpack/).
All of the build configuration files are found in the “build” subdirectory in the active module. As of this writing the active module is called “sql12” and was used to release version 2.0 RC1. The main point of entry to build the SquirreL SQL Client with ant is the file called “build.xml”. This file is special to ant in that it is the default file that ant looks for when a build configuration file isn't specified. If ant is run from the command-line in the same directory as this file with a single argument of “help”, a menu of build targets is displayed. The most useful targets - from the viewpoint of developing SQuirreL - are:
clean – cleans the previously compiled result of the source files
complile_plugins – since this target depends on targets that compile the framework and core application classes, this target will build everything.
make_install_jar – this target cleans and builds the source code, then if IzPack has been installed and properly configured, will run IzPack to create an install jar. The install jar can then be used to install the version of SQuirreL that was just built on any machine that has a Java Runtime Environment (JRE).
IzPack is an open source application which will package up files into a platform-independent installer as a single executable jar file. The IzPack configuration file called “izpack-squirrel-with-plugins.xml”will produce an installer that is capable of installing SQuirrel in “base” or “standard” configurations. The “base” configuration installs the files necessary to run SQuirreL. The “standard” configuration enhances the “base” configuration by installing a set of plugins which have been deemed stable and most likely to be useful to any user of SQuirreL. That is, no vendor-specific plugins are provided in the “standard” configuration, only plugins which provide features which are applicable to any database.
In order to use the IzPack installer to create a SQuirreL installer, IzPack must be downloaded and installed (see http://www.izforge.com/izpack/izpack-doc.pdf for detailed usage). Next, there is a file in the SQuirreL build directory that is called build.properties. Among other items, ,it contains the following configuration:
# Directory where IzPack is installed - only required
# for the "make_install_jar" target
If IzPack was installed in a directory other than “c:/tools/IzPack” change this value to whatever directory the IzPack software is installed in. This is probably the only value that will need modification. Consult build.properties for information regarding other configuration options available for building SQuirreL.
Weekly (Snapshot) Build / Release System:
Each week the SQuirreL developers create a “snapshot” release which consists of an install jar (IzPack) and source archive which represents code modifications made during that week. The purpose of these snapshots are to provide a way for end-users to provide immediate feedback to bug-fixes and enhancements made outside of the normal release cycle. In order to prevent clutter in the main build scripts that are used for development, weekly snapshots are created using a special-purpose ant build script that meets the following criteria:
The source code is checked out from scratch from the source repository on SourceForge.
The source code version is modified to specify the snapshot version (date and time snapshot was created)
The application is built and the installer is created exactly like the main build script.
The application is then auto-installed using the silent configuration option to IzPack
The installed application is then launched – this allows the person doing the build to verify that the build was successful.
The install jar file is renamed to provide date and time in the filename.
The archive file is created from the source that was used to build the installer.
The snapshot build script is located in a subdirectory of the main build directory called “snapshot”. It's ant build configuration file is called build-weekly.xml instead of build.xml to prevent confusing this with the main build configuration file. It also references a properties file to account for environment changes. The properties most likely to need modification are:
cvs.dest.dir - What temporary directory to checkout to in order to perform the build in.
izpack.home.dir - Directory where IzPack is installed
bv.install.dir - The directory that the application gets installed into for build verification testing
Other properties are less likely to change. Consult build-weekly.properties for information regarding other configuration options available for the snapshot builds.