Spiegel JAR Structure
The primary parts of the .jar file are the main and lib directories. The main directory contains a single .jar called main.jar that contains the executable spiegel program. This is the jar file that would be created if all the .class files were just stuck in a .jar file.
The lib directory contains all of the .jar files that are needed by the application to run. This includes ritopt.jar for the command-line parsing, for example. In addition, the plugin jars are placed in this directory. A plugin jar is simply a jar file containing some classes that has a special key in the manifest file called "Spiegel-Plugin" that lists all of the plugin classes contained in the .jar, separated by commas.
The only .class files directly in spiegel.jar are a set of classes in the com.simontuffs.onejar package that do the loading of the library .jar files. They know to look in main/main.jar to find the main class and lib/*.jar to find all of the library jars. They've been modified to find all of the "Spiegel-Plugin" lines and accumulate the plugin classes.
Because script and user function files need to be read from the filesystem, the onejar classes know to copy the scripts directory from spiegel.jar to the current directory that spiegel.jar is being run from. This way, there is always a scripts directory that can be read from the program.
spiegel.jar is built by running the 'dist' target in the grapecluster module followed by the 'dist' target in all of the other modules that contain plugins that need to be included. The grapecluster 'dist' will create spiegel.jar and the other 'dist' targets will add their .jar files into spiegel.jar.
--
EdwardDale?