language: python
python:
- '3.6.0'
- '3.6.1'
- '3.6.2'
- nightly

matrix:
- fast_finish: true

env:
- BUILD_MODULE=examples/java BUILD_OPTIONS=":main_run -d java.dist_type=onejar"
- BUILD_MODULE=examples/java BUILD_OPTIONS=":main_run -d java.dist_type=merge"
- BUILD_MODULE=examples/csharp BUILD_OPTIONS=":main_run"

before_install:
- if [[ "$BUILD_MODULE" == "examples/csharp" ]]; then
    sudo apt-get -qq -y update > /dev/null;
    sudo apt-get -qq -y install mono-complete gtk-sharp2 > /dev/null;
  fi

install:
- sudo apt-get update
- pip install git+https://github.com/nodepy/nodepy.git@develop
- nodepy --version
- nodepy https://nodepy.org/install-pm master
- nodepy-pm install -I
- export PATH="$(nodepy-pm bin):$PATH"

script:
- nodepy-pm run test
- craftr -p${BUILD_MODULE} $BUILD_OPTIONS -bbuild -v

language: python
python:
- 3.6
- nightly

# XXX Ideally we only want these to be installed when necessary.
addons:
  apt:
    sources:
      - sourceline: deb http://download.mono-project.com/repo/debian trusty/snapshots/5.2.0.224 main
        key_url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA6A19B38D3D831EF
      - sourceline: deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main
        key_url: https://packages.microsoft.com/keys/microsoft.asc
      - packages:
    packages:
      - mono-devel
      - ca-certificates-mono

env:
- BUILD_MODULE=examples/java BUILD_OPTIONS=":main_run -d java.dist_type=onejar"
- BUILD_MODULE=examples/java BUILD_OPTIONS=":main_run -d java.dist_type=merge"
- BUILD_MODULE=examples/csharp BUILD_OPTIONS=":main_run"

install:
- sudo apt-get update
- pip install git+https://github.com/nodepy/nodepy.git@develop
- nodepy --version
- nodepy https://nodepy.org/install-pm master
- nodepy-pm install -I
- export PATH="$(nodepy-pm bin):$PATH"

script:
- nodepy-pm run test
- craftr -p${BUILD_MODULE} $BUILD_OPTIONS -bbuild -v

Use Travis addons:apt to install mono-devel and ca-certificates-mono
Use Travis addons:apt to install mono-devel and ca-certificates-mono
