Building from source code
This page explains how to build from the source.
There are three ways you can build this code:
Having downloaded the code, add all the dependent libraries to your classpath or the classpath of the script used to compile the thing.
Import the code and libraries into an IDE such as Eclipse that will do the whole thing for you
In conjunction with the above, use the Ant build file.
A proper IDE will already understand Ant build files and present you with a nice GUI. In any case, there is at least one gotcha associated with running the code, hence this page.
Build targets explained
The gradient build file is named build-gradient.xml, and should be found in the root directory of the source distribution.
All the build targets do more or less what their descriptions say. The difference between "dist-" and "prepare-" is that the "dist-" targets clean up after themselves.
Important note on building client
An important issue is that the Gradient client, which was patched onto the Squiggle codebase, will not run from unpackaged class files. The cause of this is the security policy imposed on the DOM code to prevent access to native Java objects from within the DOM environment. The Apache build files substitute policies depending on which environment the code is run, but I haven't duplicated that here yet.
The workaround for this is to comment out lines 712-715 in org.apache.batik.apps.svgbrowser.Main. This disables all security for the entire application, and gives any loaded scripts full access to all native Java objects, i.e. access to the computer with your privileges.
- IMPORTANT:
DO NOT load untrusted documents into a client compiled with these lines commented out.
DO NOT distribute any of the builds you create with these lines commented out.
Other than that, be aware that changing the file names of loaded libraries or generated JAR files will probably require changes in the security policy and manifest files.
© 2006. Some rights reserved. Author: Ian Sollars.