# -*- coding: iso-8859-2-unix -*-

# it seems like travis-ci gives a "trusty" 14.04 LTS ubuntu env

sudo: required
dist: trusty
env:
  global:
   - secure: "DmQ3DTsvvKEg30be9kGbbGHkj1xMv5/hQOjXnaP091+lXdtqrHRwN8/Xki2qxyMeaCE3iq8UNVzppd9w/g1z75O63X96K+igVQqdXI5BHtqlKLZonTGMFVqsThjCys2oqRdfxpiZ+ggbImbzFwPqhKCtIeoQTFfDMJSpDpwl9eU="

addons:
  coverity_scan:
    project:
      name: "ralovich/antpm"
      description: "ANT+minus Build submitted via Travis CI"
    notification_email: ralovich@in.tum.de
    build_command_prepend: "pwd && cd cmake-build && pwd && cmake ../src -DCMAKE_BUILD_TYPE=Debug -DUSE_BOOST_TEST=TRUE"
    build_command:   "make"
    branch_pattern: coverity_scan
    build_script_url: "https://raw.githubusercontent.com/ralovich/antpm/master/scripts/coverity_scan_script.sh"
  apt:
    sources:
    - ubuntu-toolchain-r-test
    - boost-latest
    - llvm-toolchain-precise-3.7
    packages:
    - gcc-5
    - g++-5
    - clang-3.7
    - cmake
    - pkg-config
    - libusb-1.0-0-dev
    - libxml2-dev
    - libboost1.55-dev
    - libboost1.55-all-dev
    - libboost-atomic1.55-dev
    - libboost-date-time1.55-dev
    - libboost-exception1.55-dev
    - libboost-filesystem1.55-dev
    - libboost-program-options1.55-dev
    - libboost-system1.55-dev
    - libboost-test1.55-dev
    - libboost-thread1.55-dev
    - valgrind

language: cpp
script: cmake
compiler:
  - gcc
  - clang
notifications:
  email:
    recipients:
      - ralovich@in.tum.de
    on_success: always
    on_failure: always
branches:
  only:
    - master
    - coverity_scan

before_install:
install:
  - if [ "$CXX" = "g++" ]; then export CXX="g++-5" CC="gcc-5"; fi
  - if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.7" CC="clang-3.7"; fi

before_script:
  - uname -a
  - free
  - cat /proc/cpuinfo
  - $CC -v
  - $CXX -v
  - dpkg -l | grep ^ii | grep boost
  - mkdir cmake-build
script:
  - cd cmake-build
  - cmake ../src -DCMAKE_BUILD_TYPE=Release -DUSE_BOOST_TEST=TRUE -DCMAKE_INSTALL_PREFIX=/usr -DUSE_BOOST_STATIC_LINK=FALSE && VERBOSE=1 make -j4 && make test ARGS=-j99
  - make clean
  - cmake ../src -DCMAKE_BUILD_TYPE=Debug -DUSE_BOOST_TEST=TRUE -DCMAKE_INSTALL_PREFIX=/usr -DUSE_BOOST_STATIC_LINK=FALSE && VERBOSE=1 make -j4 && make test ARGS=-j99
  - make clean

