sudo: false
language: java
jdk: 
 - oraclejdk7
 - oraclejdk8
addons:
 apt:
  packages:
  - libgtest-dev
 coverity_scan:
   project:
     name: Yakindu/statecharts
   notification_email: a.muelder@googlemail.com
   build_command: mvn -f ${TRAVIS_BUILD_DIR}/releng/org.yakindu.sct.releng/pom.xml clean verify
   branch_pattern: coverity_scan
cache:
  directories:
  - $HOME/.m2
env:
  global:
  - DISPLAY=:99.0
  - GTEST_DIR=${TRAVIS_BUILD_DIR}/gtest
  # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
  # via the "travis encrypt" command using the project repo's public key
  - secure: "e6AtFe0HJAHRdmzp4uXx4b+xZaEUUd2jeYiLdIkYuRa84op9iSzCmPj5uT3Vkvqps5snBrDx47Wl1EO9rl+Z91WYp1JgTT5Ek37SKj/ikhJ0HfAYBycU/MRTMO5wXEfwL29G0gjygzFxlUe7t/Y92M/VsvlEQ9nHrtqJ4hQA968="
  matrix:
  - TARGET=Mars.target
  - TARGET=Luna.target
  - TARGET=Neon.target
matrix:
  exclude:
   - jdk: oraclejdk8
     env: TARGET=Mars.target
   - jdk: oraclejdk8
     env: TARGET=Luna.target
   - jdk: oraclejdk7
     env: TARGET=Neon.target
before_script:
 - mkdir gtest 
 - cd gtest
 - cp -r /usr/src/gtest/. .
 - ls
 - cmake CMakeLists.txt
 - make
 - cd $TRAVIS_BUILD_DIR
before_install:
- sh -e /etc/init.d/xvfb start - sleep 10
script:
- cd releng/org.yakindu.sct.releng
- mvn clean verify -P$TARGET,tests
- cd ../org.yakindu.sct.repository/target
- zip -r updatesite.zip repository
- cd $TRAVIS_BUILD_DIR
deploy:
  skip_cleanup: true
  provider: releases
  api_key: 
   secure: f48bN42ninJcN0yp8T9DU7ay9aQVjbEcxEvD/UCEMBNBOnBFgomtFGa0jFMtbIwQk6Vx5yYcs0dDtNWqPsoq6v5m9eihVujhLx456yhzpin03kjydSQipjTbpZjsw+yUHx79QfqAIjGsAilU3uWVTBhTXEjEm0DFuJvOYgpuJA8=
  file: releng/org.yakindu.sct.repository/target/updatesite.zip
  on:
    tags: Yakindu/statecharts
    condition: "$TRAVIS_TAG =~ ^release.*$"
notifications:
  webhooks:
    urls:
      - https://webhooks.gitter.im/e/7b7c5ba24ab36f09d721
    on_success: change  # options: [always|never|change] default: always
    on_failure: always  # options: [always|never|change] default: always
    on_start: never     # options: [always|never|change] default: always
