Build Instructions

David Ray edited this page Mar 27, 2016 · 5 revisions

How to Build


Building requires:

  • JDK 8
  • Gradle 1.7+

Note: Info on installing gradle can be found on the wiki (look at #3) here.

Linux Gradle Issues? see the wiki here or use the reference build environment (below).


Execute a quick sanity check by running all the tests from within the <path to git repo>/

gradle check  # Executes the tests and runs the benchmarks


gradle -Pskipbench check  # Executes the tests w/o running the benchmarks

Reference Build Environment

As a convenience to developers, we provide a docker image with the needed software to build the library from sources. This approach relies on the Docker Toolbox, which is installable on Mac and Windows. If you're using Linux, skip to the Build the Docker Image section.

Below we'll use a technique to share your cloned sources from your project folder into a docker container, then build the library with gradle. The build outputs are written back to your project folder, not isolated within the container.

Install Docker Toolbox

Follow the instructions on the toolbox site, then open the quickstart terminal. You should adjust the memory settings on the toolbox VM, because the default (2GB) is insufficient for the unit test suite.

[]$ docker-machine rm default
About to remove default
Are you sure? (y/n): y

[]$ docker-machine create -d virtualbox --virtualbox-memory 4096 default

Build the Docker Image

The docker image, which you simply build once, contains OpenJDK 8 and Gradle. It doesn't contain any source code; when we later run the container, the source code is read directly from your project folder.

[]$ docker build -t $USER/ .
Successfully built <IMAGE ID>

Run the Container

Run a container based on the docker image, which launches a bash shell where you'll fire up gradle.

[]$ docker run -it --rm -v `pwd`:/home/vagrant/ $USER/

Notice that the current directory (which should be your project folder) is shared into the container, as /home/vagrant/


Build the project as usual.

vagrant@96e54fd78012:~$ cd /home/vagrant/
vagrant@96e54fd78012:~/$ gradle -Pskipbench check

vagrant@96e54fd78012:~/$ exit


You can remotely debug the unit tests from your host into the container. Simply expose the debug port when you start the container, run gradle with debugging enabled, then attach with your IDE. Here's an example:

[]$ docker-machine ip default
[]$ docker run -it --rm -p 5005:5005 -v `pwd`:/home/vagrant/ $USER/
vagrant@19e4d58730c4:~$ cd
vagrant@19e4d58730c4:~/$ gradle -Dtest.debug -Pskipbench check
Listening for transport dt_socket at address: 5005

# attach to from within your IDE!

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.