<commit_before>notifications:
  irc:
    channels:
#     - "chat.freenode.net#darktable"
      - secure: "<KEY>
    skip_join: true
    template:
      - "%{repository}#%{build_number} (\x037%{branch}\x03 - \x02%{commit}\x02 : \x033%{author}\x03): \x1f\x02%{message}\x02\x1f"
      - "Build details : <%{build_url}>"
  email:
    recipients:
#     - <EMAIL>
      - secure: "<KEY>
    on_success: always
    on_failure: always

language: generic

os:
  - linux
  - osx

dist: trusty # *sigh*
group: unstable
sudo: required

git:
  depth: 9999999

services:
  - docker

before_install:
  - if [[ "$TARGET" == "SONARQUBE" && ("$TRAVIS_PULL_REQUEST" != "false" || "$TRAVIS_SECURE_ENV_VARS" != "true" || ("$TRAVIS_BRANCH" != "develop" && "$TRAVIS_BRANCH" != "master")) ]]; then
      exit;
    elif [[ "$TARGET" == "WWW" && ("$TRAVIS_PULL_REQUEST" != "false" || "$TRAVIS_SECURE_ENV_VARS" != "true" || "$TRAVIS_BRANCH" != "develop") ]]; then
      exit;
    elif [[ "$EXTRA" == "NODOCKER" ]]; then
      echo "oracle-java8-installer hold" | sudo dpkg --set-selections;
      echo "oracle-java9-installer hold" | sudo dpkg --set-selections;
      travis_retry sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y;
      travis_retry sudo apt-get update -q;
      travis_retry sudo apt-get install -y -q -f --fix-missing cmake g++-4.8 g++-6 git libjpeg-dev libpugixml-dev libxml2-utils make ninja-build zlib1g-dev;
    elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
      docker pull darktable/rawspeed;
    elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
      brew update && brew tap Homebrew/bundle && cd .ci && brew bundle --verbose;
    fi

env:
  global:
    # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
    #   via the "travis encrypt" command using the project repo's public key
    - secure: "<KEY>
    - SRC_DIR=/build/rawspeed
    - BUILD_DIR=/build/rawspeed-build
    - INSTALL_PREFIX=/build/rawspeed-install
    - CFLAGS="-pipe" CXXFLAGS="-pipe"
    - TARGET=build
  matrix:
    - CC=cc CXX=c++
    - CC=cc CXX=c++ FLAVOR=Coverage

matrix:
  fast_finish: true
  include:
  - os: linux
    sudo: required
    services:
      - docker
    env: CC=clang-3.9 CXX=clang++-3.9 ECO="-DWITH_PTHREADS=OFF"
  - os: linux
    env: CC=gcc-4.8 CXX=g++-4.8 EXTRA=NODOCKER
  - os: linux
    sudo: required
    services:
      - docker
    env: CC=cc CXX=c++ TARGET=SONARQUBE FLAVOR=Coverage EXTRA_OPTS="--tmpfs /root/.sonar --volume $HOME/.sonar/cache:/root/.sonar/cache"
    cache:
      directories:
        - '$HOME/.sonar/cache'
  - os: linux
    sudo: required
    services:
      - docker
    env: CC=clang-3.9 CXX=clang++-3.9 TARGET=WWW

# linux clang Coverage build OOM's in gcov during final codecov report collection
# OSX gcc Coverage build produces invalid .gcno files

script:
  - if [[ "$TARGET" == "SONARQUBE" && ("$TRAVIS_PULL_REQUEST" != "false" || "$TRAVIS_SECURE_ENV_VARS" != "true" || ("$TRAVIS_BRANCH" != "develop" && "$TRAVIS_BRANCH" != "master")) ]]; then
      exit;
    fi;
  - if [[ "$TARGET" == "WWW" && ("$TRAVIS_PULL_REQUEST" != "false" || "$TRAVIS_SECURE_ENV_VARS" != "true" || "$TRAVIS_BRANCH" != "develop") ]]; then<commit_msg>Enable sonarqube for raf-compressed branch.<commit_after>notifications:
  irc:
    channels:
#     - "chat.freenode.net#darktable"
      - secure: "<KEY>
    skip_join: true
    template:
      - "%{repository}#%{build_number} (\x037%{branch}\x03 - \x02%{commit}\x02 : \x033%{author}\x03): \x1f\x02%{message}\x02\x1f"
      - "Build details : <%{build_url}>"
  email:
    recipients:
#     - <EMAIL>
      - secure: "<KEY>="
    on_success: always
    on_failure: always

language: generic

os:
  - linux
  - osx

dist: trusty # *sigh*
group: unstable
sudo: required

git:
  depth: 9999999

services:
  - docker

before_install:
  - if [[ "$TARGET" == "SONARQUBE" && ("$TRAVIS_PULL_REQUEST" != "false" || "$TRAVIS_SECURE_ENV_VARS" != "true" || ("$TRAVIS_BRANCH" != "develop" && "$TRAVIS_BRANCH" != "master" && "$TRAVIS_BRANCH" != "raf-compressed")) ]]; then
      exit;
    elif [[ "$TARGET" == "WWW" && ("$TRAVIS_PULL_REQUEST" != "false" || "$TRAVIS_SECURE_ENV_VARS" != "true" || "$TRAVIS_BRANCH" != "develop") ]]; then
      exit;
    elif [[ "$EXTRA" == "NODOCKER" ]]; then
      echo "oracle-java8-installer hold" | sudo dpkg --set-selections;
      echo "oracle-java9-installer hold" | sudo dpkg --set-selections;
      travis_retry sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y;
      travis_retry sudo apt-get update -q;
      travis_retry sudo apt-get install -y -q -f --fix-missing cmake g++-4.8 g++-6 git libjpeg-dev libpugixml-dev libxml2-utils make ninja-build zlib1g-dev;
    elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
      docker pull darktable/rawspeed;
    elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
      brew update && brew tap Homebrew/bundle && cd .ci && brew bundle --verbose;
    fi

env:
  global:
    # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
    #   via the "travis encrypt" command using the project repo's public key
    - secure: "<KEY>
    - SRC_DIR=/build/rawspeed
    - BUILD_DIR=/build/rawspeed-build
    - INSTALL_PREFIX=/build/rawspeed-install
    - CFLAGS="-pipe" CXXFLAGS="-pipe"
    - TARGET=build
  matrix:
    - CC=cc CXX=c++
    - CC=cc CXX=c++ FLAVOR=Coverage

matrix:
  fast_finish: true
  include:
  - os: linux
    sudo: required
    services:
      - docker
    env: CC=clang-3.9 CXX=clang++-3.9 ECO="-DWITH_PTHREADS=OFF"
  - os: linux
    env: CC=gcc-4.8 CXX=g++-4.8 EXTRA=NODOCKER
  - os: linux
    sudo: required
    services:
      - docker
    env: CC=cc CXX=c++ TARGET=SONARQUBE FLAVOR=Coverage EXTRA_OPTS="--tmpfs /root/.sonar --volume $HOME/.sonar/cache:/root/.sonar/cache"
    cache:
      directories:
        - '$HOME/.sonar/cache'
  - os: linux
    sudo: required
    services:
      - docker
    env: CC=clang-3.9 CXX=clang++-3.9 TARGET=WWW

# linux clang Coverage build OOM's in gcov during final codecov report collection
# OSX gcc Coverage build produces invalid .gcno files

script:
  - if [[ "$TARGET" == "SONARQUBE" && ("$TRAVIS_PULL_REQUEST" != "false" || "$TRAVIS_SECURE_ENV_VARS" != "true" || ("$TRAVIS_BRANCH" != "develop" && "$TRAVIS_BRANCH" != "master" && "$TRAVIS_BRANCH" != "raf-compressed")) ]]; then
      exit;
    fi;
  - if [[ "$TARGET" == "WWW" && ("$TRAVIS_PULL_REQUEST" != "false" || "$TRAVIS_SECURE_ENV_VARS" != "true" || "$TRAVIS_BRANCH" != "develop") ]]; then
{'fraction_non_alphanumeric': 0.16764797025100714, 'fraction_numerical': 0.014254725751471955, 'mean_word_length': 3.1193363114231016, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1110744', 'n_tokens_mistral': 2577, 'n_tokens_neox': 2480, 'n_words': 531}