Local Build Setup

Basic Requirements

You need subversion or git-svn to work with the code.

You need ant to build it. If your development system is on Linux, use your distribution's package manager to install it. If you're developing on OS X, the preferred method is homebrew. Note: you will need to get the Apple Developer Tools installed to use homebrew (as it compiles from source). You can get the developer tools from the App Store (OS X 10.7 or later) or by registering an account with Apple's Developer Connection (all).

You need apache, tomcat6 and postgres, at a minimum (you probably will also need mysql in the interim as some of our databases use it). OS X includes apache; binaries for postgres and tomcat are readily available. Check your Linux distribution if that OS is preferred.

Mirroring the server environment

We tend to work in the ~quarkcat directory. (that is, /home/quarkcat, /sandbox/quarkcat, etc.). There is a particular structure to our directory:

~quarkcat/
~quarkcat/sw/
~quarkcat/sw/local-settings
~quarkcat/sw/i2u2svn
~quarkcat/sw/tomcat

The root user directory ( ~quarkcat) contains build scripts. Most important are setenv.sh, deploy-from-svn and internal-deploy-from-svn. The first sets local environment variables, the second contains a wrapper for internal-deploy-from-svn to properly change rights.

The local-settings directory holds specific local-machine configuration details. This varies depending on computer. Look on www18 to see an example configuration and on what to do.

The i2u2svn directory is where, by default, we check out code to deploy

The tomcat directory is where tomcat lives. On the server and on local machines this is often a symbolic link somewhere else (e.g. /var/lib/tomcat6 or /opt/tomcat or /usr/local/tomcat)

Now, the pesky parts:
~quarkcat/build.properties has critical paths located: you will need to edit these.
~quarkcat/sw/local-settings/common/resources/classes/elab.properties has elab-wide configuration details, such as for the database.
~quarkcat/sw/local-settings/$ELAB/resources/classes/elab.properties.$ELAB has elab-specific configuration details
~quarkcat/.vdsrc has configuration details for the metadatabase. Note! Hidden file

Once set up, try to build everything. Run this command in the ~quarkcat directory ./deploy-from-svn $BRANCH when

It should try and pull things in and build it. There's a logfile created if there are any problems.

If you want Apache to serve files on port 80 (so you can do things like http://localhost/cosmic) you'll need to set up local apache configuration to proxy all requests to tomcat. mod_proxy, mod_jk and mod_proxy_ajp are the most common solutions (and will vary depending on your local computer). SSL testing will require certificate generation. See /etc/apache2/sites-available/ on www18 for examples.

Building from Eclipse and directly deploying into Tomcat

This is unpleasant, finicky and often doesn't quite work right. You'll have to set build destinations for specific directories straight into Tomcat (and enable Tomcat's symbolic linking, disabled by default). You will also need to manually add libraries in common/lib to Tomcat's build path (and these can and do change based on revision). Ask Phong for an example workspace file

If for, whatever reason, you still want to do this:

Symlink common-cms and common-ligo to common

Open up the Build Path, click Source and start adding:

i2u2/$ELAB/resources/classes
Output folder: i2u2/.build/classes

i2u2/$ELAB/resources/tags
Output folder: i2u2/.build/tags

i2u2/$ELAB/src/java
Output folder: i2u2/.build/classes

i2u2/$ELAB/src/jsp
Output folder: i2u2/.build/ELAB

i2u2/common/lib
Output folder: i2u2/.build/lib

i2u2/i2u2
Output folder: i2u2/.build/i2u2

i2u2/local-settings/common/resources/classes Output folder: i2u2/.build/classes

Default build: i2u2/.build2

-- Main.PhongNguyen - 2012-11-17
Topic revision: r2 - 2013-08-07, forero
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback