language: cpp
compiler:
  - gcc
  - clang
install:
  - sudo add-apt-repository --yes ppa:kalakris/cmake
  - sudo add-apt-repository --yes ppa:fenics-packages/fenics-exp/swig
  - sudo apt-get update -qq
  - sudo apt-get install -y -qq swig3.0 python git cmake
  - sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
  - sudo update-java-alternatives -s java-8-oracle
before_script:
  - if [ "$CC" = "gcc" ]; then export BUILDJAVA=ON; else export BUILDJAVA=OFF; fi
  - export JAVA_HOME=/usr/lib/jvm/java-8-oracle
script:
  - mkdir build && cd build && cmake -DBUILDSWIGJAVA=$BUILDJAVA -DNODE_ROOT_DIR:PATH=/home/travis/.nvm/v0.10.36/include .. && make && make test
