sudo: false
language: java
jdk: oraclejdk7
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: "SjGXYhNOkg6SDuiTo8NZYmqqWxTP+8CogkV9whFwonXGOY9xT1LxO8BD5Q3j2WM6I9gHPExsPyo6ejHq2D4yBjp8ylONtAFkR9Hmd/I9qbW2Tcj0MU3dRACu0L4ko1Uh33IvJWZX+XqTZQMRApch9Wuasj0daUSdYo81GSn5JWI="
  matrix:
  - TARGET=Mars.target
  - TARGET=Luna.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: BSEYtMYXInrXum0eOmisxDIUw5puH1WycKmXvnBJKn3GeekCWV2UCF4Elocmkil8MBzYQ3LlpiihncBalvVEzpgyVEo1Z0wnxiQtatZU0gMuw6piu+Owi5Om/kB6J4DvZShLt5qWYGVynBRhGsC4jFYpakCSHySy3icg1wI1sfI=
  file: releng/org.yakindu.sct.repository/target/updatesite.zip
  on:
    tags: Yakindu/statecharts
    condition: "$TRAVIS_TAG =~ ^release.*$"
