Table of Contents
Common
Directory structure according to the two projects
Common is used for the desktop build and also for the web build. Because of the differences between the two kind of projects, we need different ways for the compilation.
Compilation from Eclipse and from command line also differs. Eclipse is fine tuned via .classpath (for the desktop build) and the Common.gwt.xml file (for the web build). Command line compilation for the desktop build is defined in the make-vanilla-jars and the build.xml files. For a web build command line compilation we provide a build.xml file in the common/ directory.
It is important to know which directories are used for the different projects. For command line compilation of the desktop we have to remove common/src/geogebra/common/Common.java and only use the Java files from common/src/geogebra/common/ and common/src/org/. (The other Java files from the common must be omitted. See the make-vanilla-jars script for details on this.) For command line compilation of the web we have to exclude common/src/org/ and common/src/geogebra/common/kernel/parser/ParseException.java. (See the "javac" target in web/build.xml for details. The same technique is used in common/web-build.xml, but this file is currently unused according to [14571].) On the other hand, we must tell ecj which directories should be used from common exactly.
The command line build subsystem (web/build) of the web project uses the classes and also the Java files of the common project: the class files are loaded from common/war/WEB-INF/classes and the Java files are loaded from src/geogebra/{common,jre,webapache,jung}. The Common.gwt.xml file is also used from the same directory. These files are copied by using a symlink (in web/build), and the web/build.xml file has been prepared to work with the precompiled classes.
The src/geogebra/webapache directory contains parts of the org.apache.commons.math package: those parts which were made compatible with the GWT compiler and used in the Web project. The entire org.apache.commons.math package is in the src/ directory; that is for use with the Desktop project and reusable and updatable later. With some tricks with the Common.gwt.xml and the .classpath file this was possible.
The src/geogebra/jung(/edu/uci/ics/jung) directory contains parts of the edu.uci.ics.jung package: those parts which were made compatible with the GWT compiler and used in the Web project. The rest is in desktop(/edu/uci/ics/jung); that is for use with the Desktop project and reusable and updatable later. (This information should be double-checked by Judit.) See [16376], [16377], [16380] and [16382] and http://groups.google.com/group/geogebra-dev/browse_thread/thread/c8a271a83d24af91 for more details, and also [15377] and [15379] on an attempt to fix these types of problems in general.
TBD: Explaining the Eclipse configuration files (and maybe fix them to avoid any errors in Eclipse).
Packaging into JARs
Almost all Java packages go into geogebra_main.jar currently. You can modify this behavior in desktop/build.xml if a change is required. Currently the common/src/geogebra/common folder is copied to desktop/geogebra/common and the geogebra_main.jar file will contain the .class files from Common as well; after packaging this directory will be removed.
As two exceptions, the jung and the apache files go to geogebra_algos.jar. So we first copy their .class files from common to desktop.
