<commit_before>sudo: required
services:
- docker
before_install:
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
    brew update;
    brew install qt5;
  else
    git submodule update --init --recursive;
    curl https://installer.id.ee/media/sources/public.key | sudo apt-key add -;
    sudo apt-add-repository 'deb http://installer.id.ee/media/ubuntu/ trusty main';
    sudo apt-get update -qq;
    sudo apt-get install -y libdigidocpp-dev libldap2-dev libpcsclite-dev libssl-dev qtbase5-dev qttools5-dev qttools5-dev-tools gettext;
  fi
script:
- mkdir build
- cd build
- cmake -DBREAKPAD="" ..
- make
- cd ..

os:
- linux

env:
  global:
  - secure: vX847To3osqI7JytpiH5r6xlXS9r8KCNCPP3pu2yvGxAgmz917xG1lrqRGOReoCe/08hkh+gMA9vLjIyUwDlUvZuKJr5g5iPfa85/m9iPe24DLOlf9zLI5It0MFNTLYFQ5DXFmX77+/lcB9ypDQtE5w9XK+xZjyC9xr9viye77E=
addons:
  coverity_scan:
    project:
      name: open-eid/qdigidoc
      description: Build submitted via Travis CI
    notification_email: <EMAIL>
    build_command_prepend: mkdir coverity; cd coverity; cmake -DBREAKPAD='' ..
    build_command: make
    branch_pattern: coverity_scan

before_deploy:
- export VERSION=${TRAVIS_TAG:1}
- rm -rf build
- cd ..
- mv qdigidoc qdigidoc-${VERSION}
- tar czf qdigidoc-${VERSION}.tar.gz --exclude-vcs qdigidoc-${VERSION}
deploy:
  provider: releases
  api_key:
    secure: <KEY>
  file: qdigidoc-${VERSION}.tar.gz
  skip_cleanup: true
  on:
    tags: true
    condition: "$TRAVIS_OS_NAME = linux"<commit_msg>Build packages in travis and enable OSX<commit_after>language: c++
sudo: required
dist: trusty
os:
- linux
- osx
osx_image: xcode6.4

before_install:
- git submodule update --init --recursive && if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
    brew update;
    brew install qt5;
    curl --location "https://github.com/open-eid/libdigidoc/releases/download/v3.10.2/libdigidoc_3.10.1.1213.pkg" -o libdigidoc.pkg;
    curl --location "https://github.com/open-eid/libdigidocpp/releases/download/v3.12.0/libdigidocpp_3.12.0.1318.pkg" -o libdigidocpp.pkg;
    curl --location "https://github.com/open-eid/esteid-pkcs11/releases/download/v3.10.1/esteid-pkcs11_3.10.1.64.pkg" -o esteid-pkcs11.pkg;
    sudo installer -verboseR -pkg libdigidoc.pkg -target /;
    sudo installer -verboseR -pkg libdigidocpp.pkg -target /;
    sudo installer -verboseR -pkg esteid-pkcs11.pkg -target /;
  else
    curl https://installer.id.ee/media/sources/public.key | sudo apt-key add -;
    sudo apt-add-repository 'deb http://installer.id.ee/media/ubuntu/ trusty main';
    sudo apt-get update -qq;
    sudo apt-get install -y libdigidocpp-dev libldap2-dev libpcsclite-dev libssl-dev qtbase5-dev qttools5-dev qttools5-dev-tools gettext dh-make devscripts dpkg-dev cdbs;
  fi
script: export BUILD_NUMBER=${TRAVIS_BUILD_NUMBER} && if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
    mkdir build && cd build && cmake -DQTSDK=/usr/local/opt/qt5 ..;
    make zipdebug macdeployqt zip && cd ..;
  else
    VERSION=3.12.0.${TRAVIS_BUILD_NUMBER};
    yes | dh_make --createorig --addmissing --defaultless -p qdigidoc_${VERSION};
    dch --distribution $(lsb_release -cs) -v ${VERSION} "Release ${VERSION}.";
    dpkg-buildpackage -rfakeroot -us -uc;
  fi

env:
  global:
  - secure: vX847To3osqI7JytpiH5r6xlXS9r8KCNCPP3pu2yvGxAgmz917xG1lrqRGOReoCe/08hkh+gMA9vLjIyUwDlUvZuKJr5g5iPfa85/m9iPe24DLOlf9zLI5It0MFNTLYFQ5DXFmX77+/lcB9ypDQtE5w9XK+xZjyC9xr9viye77E=
addons:
  coverity_scan:
    project:
      name: open-eid/qdigidoc
      description: Build submitted via Travis CI
    notification_email: <EMAIL>
    build_command_prepend: mkdir coverity; cd coverity; cmake -DBREAKPAD='' ..
    build_command: make
    branch_pattern: coverity_scan

before_deploy:
- export VERSION=${TRAVIS_TAG:1}
- git clean -d -x -f
- cd ..
- mv qdigidoc qdigidoc-${VERSION}
- tar czf qdigidoc-${VERSION}.tar.gz --exclude-vcs qdigidoc-${VERSION}
deploy:
  provider: releases
  api_key:
    secure: <KEY>
  file: qdigidoc-${VERSION}.tar.gz
  skip_cleanup: true
  on:
    tags: true
    condition: "$TRAVIS_OS_NAME = linux"
{'fraction_non_alphanumeric': 0.12406947890818859, 'fraction_numerical': 0.033995037220843675, 'mean_word_length': 3.6709154113557356, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5339700', 'n_tokens_mistral': 1734, 'n_tokens_neox': 1634, 'n_words': 316}