sudo: required
dist: trusty

language: node_js
node_js:
  - "6"

os:
  - linux
  # - osx

before_install:
  - if [ $TRAVIS_OS_NAME == "linux" ]; then
      export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0;
      sh -e /etc/init.d/xvfb start;
      sleep 3;
      sudo apt-get --yes install haskell-platform;
    else
      curl "https://downloads.haskell.org/~platform/7.10.3/Haskell%20Platform%207.10.3%2064bit.pkg" -o "x.pkg";
      travis_wait sudo installer -pkg x.pkg -target / ;
    fi


install:
  - ghc --version
  - cabal --version
  - cabal update
  - cabal install ghc-mod --constraint=extra==1.4.12 --constraint=safe==0.3.9 --constraint=hlint==1.9.35
  - git clone https://github.com/hoovercj/fast-tags.git
  - cabal install fast-tags/fast-tags.cabal
  - cabal install hasktags
  - if [ $TRAVIS_OS_NAME == "linux" ]; then 
      export PATH="/home/travis/.cabal/bin:$PATH";
    else
      export PATH="/Users/travis/Library/Haskell/bin:$PATH";
    fi
  - cd client
  - npm install
  - npm run vscode:prepublish
  - cd ../server
  - npm install
  - npm run compile

script:
  - npm test
  - npm run tslint
  - cd ../client
  - npm run tslint
sudo: false

# Caching so the next build will be fast too.
cache:
  directories:
  - $HOME/.stack

language: node_js
node_js:
  - "6"

os:
  - linux
  # - osx

addons:
  apt:
    packages:
      # Stack dependencies
      - libgmp-dev

before_install:
  # Download and unpack the stack executable
  - mkdir -p ~/.local/bin
  - export PATH="$HOME/.local/bin:$PATH"
  - |
    if [ `uname` = "Darwin" ]
    then
      travis_retry curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
    else
      travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
    fi
install:
  - stack --version
  - stack install --install-ghc --local-bin-path ~/.local/bin fast-tags hasktags ghc-mod
  - cd client
  - npm install
  - npm run vscode:prepublish
  - cd ../server
  - npm install
  - npm run compile

script:
  - npm test
  - npm run tslint
  - cd ../client
  - npm run tslint
Switch Travis-CI build to use stack
Switch Travis-CI build to use stack
