Sakai CLE Courseware Management
上QQ阅读APP看书,第一时间看更新

Building from the source

This is an advanced-use section for those of you who want to build Sakai from source code and perhaps, develop tools later. If you are more interested in understanding what Sakai is or how to create great course material, feel free to skip ahead.

Currently, the source code of Sakai and its contributed projects is stored in a publicly available subversion repository. Subversion is a revision control system that stores the source code, a record of all changes, and comments on those changes. If you are a developer who wants to be up-to-date, or a system integrator who wants to resolve bug fixes efficiently, this is where you want to get your code. The Sakai Subversion repository is open to the public. Anyone can browse through it, get the code, and see its quality. The source code is available at: https://source.sakaiproject.org/svn.

Community donated project managers divide the code into tags, branches and trunk. The most up-to-date source code is the trunk (https://source.sakaiproject.org/svn/sakai/trunk), which is the central place where developers place their ever-changing code. The trunk mostly builds without any problems, but occasionally, there is a hiccup due to a premature committing and for a few hours, the source may fail to build. Do not worry; this is normal in a development cycle.

Currently, the safest place to obtain the source code is from the latest maintenance branch (https://source.sakaiproject.org/svn/sakai/branches), which has added patches to resolve known issues. This is the code recommended for production deployments. As Sakai ages, expect the 2-9-x and 2-10-x branches to emerge. Currently, there are supported branches for versions 2.7 and 2.8.

Tags (https://source.sakaiproject.org/svn/sakai/tags) are snapshots in time that testers and automatic mechanisms have quality-assured completely. The major version number (2.6, 2.7, and so on) is incremented as the functionality changes, and the branch manager releases point increments in a version number for a set of well-tested patches.

The level of participation from testers and early adopters, who install a tagged version as soon as it is released, has a positive implication: As the community grows and more testers and early adopters are involved, the quality improves.

The contributed section (https://source.sakaiproject.org/contrib) stores organization-specific modifications and tools that have not yet made it as part of the official release.

Building the demonstration from raw source is straightforward and the recipe works for Windows, UNIX/Linux, and Macintosh environments.

After building from source, you'll have created two demonstration versions. One runs on Windows, the other runs in UNIX/Linux or Macintosh environments.

You first need to install Subversion tools so that you can download the code. You also need Java 1.6, which you installed previously, to run the Sakai demonstration the first time; and Maven, a tool for managing the build cycle. On a Debian Linux box, the following recipe works:

sudo apt-get install subversion-tools sudo apt-get install maven2

For Windows and Macintosh computers, you can find the Subversion binaries at http://subversion.tigris.org and the Maven 2 binaries at http://maven.apache.org/download.html.

Under a work directory of choice, run the Subversion tool to download the code:

svn co https://source.sakaiproject.org/svn/sakai/trunk/ sakai

The command co means checkout and sakai is the directory to store the source code. Navigate to the source code directory via:

cd sakai

On my development machine, it takes about 20 minutes to build the binary. The source code contains hundreds of thousands of lines of active code. Therefore, the Maven tool requires a significant amount of memory while running to complete its task. Setting MAVEN_OPTS defines the upper limits to the allocated memory.

For example, to reserve 256MB, you need to set MAVEN_OPTS to -Xmx 256m and then run Maven from the command line:

mvn -Ppack-demo install

A lot of text will flow past with a success message at the end. At the end of a successful build, you will find the Windows and Linux/Mac demos under the pack-demo directory.