<commit_before>language: cpp

#
# Define the build matrix
#
matrix:
  include:

    - os: osx
      osx_image: xcode8.3
      compiler: clang
      env: [ FAST=ON ]

    - os: osx
      osx_image: xcode8.3
      compiler: clang
      env: [ ASAN=ON ]

    - os: linux
      compiler: clang
      env: [ ASAN=ON ]

    - os: osx
      osx_image: xcode8.3
      compiler: gcc

    - os: osx
      osx_image: xcode8.3
      compiler: clang

    - os: osx
      osx_image: xcode7.3
      compiler: clang

    - os: linux
      compiler: gcc

    - os: linux
      compiler: clang

before_install:
  - |
    if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
      brew update
      brew install ninja
    fi
  - |
    if [[ "$TRAVIS_OS_NAME" == "osx" && "$FAST" != "ON" ]]; then
      rvm install 2.3.1
      rvm use 2.3.1
      gem install test-unit --no-document
      if [[ "$CC" == "gcc" ]]; then
        brew install gcc
        brew link --overwrite gcc
        export CC=gcc-7
        export CXX=g++-7
        # Install yaml-cpp from source, since otherwise linking fails
        # We upgrade CMake and Boost first, since otherwise the last Homebrew command would install them from source too
        brew upgrade cmake; brew upgrade boost; brew install --cc=gcc-7 --c++11 yaml-cpp
      else
        # Linking the Homebrew versions of Botan and yaml-cpp using `gcc` fails on macOS
        brew install botan
        brew install yaml-cpp
        # Unfortunately Xerces 3.2 causes multiple problems if we translate Elektra with GCC on macOS
        brew install xerces-c
      fi
      brew install augeas
      brew install checkbashisms
      brew install dbus
      brew install discount
      brew install gobject-introspection
      brew install libgcrypt
      brew install libgit2
      brew install lua
      brew install openssl
      brew install python
      brew install python3
      brew install qt
      brew install swig
      brew install yajl
      pip2 install cheetah # Required by kdb-gen
      export Qt5_DIR=/usr/local/opt/qt5
    fi
  - |
    if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
      sudo apt-get -qq update
      sudo apt-get install clang-format-3.8
      sudo apt-get install ninja-build
      sudo apt-get install libboost-all-dev
      sudo apt-get install libyaml-cpp-dev
    fi

#
# Source is checked out in $TRAVIS_BUILD_DIR
# Build directory will be TRAVIS_BUILD_DIR/../build
#
before_script:
  - cd $TRAVIS_BUILD_DIR/..
  - >
    [[ "$TRAVIS_OS_NAME" == "linux" ]] && INSTALL_DIR="$PWD/install" || INSTALL_DIR="/usr/local"
  - SYSTEM_DIR="$PWD/kdbsystem"
  - mkdir build && cd build
  - >
    [[ $ASAN == ON ]] && CMAKE_OPT=(-DENABLE_ASAN=ON) || CMAKE_OPT=()
  - |
    if [[ "$TRAVIS_OS_NAME" == "linux" && "$CC" == "clang" || "$TRAVIS_OS_NAME" == "osx" && "${CC:0:3}" == "gcc" ]]; then
      CMAKE_OPT+=("-DCOMMON_FLAGS=-Werror")
    fi
  - plugins="ALL;-jni"
  - |
    if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
      python2_ver=$(python2 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))') &&                  \
        CMAKE_OPT+=("-DPYTHON2_INCLUDE_DIR:PATH=$(python2-config --prefix)/include/python${python2_ver}") &&      \
        CMAKE_OPT+=("-DPYTHON2_LIBRARY:FILEPATH=$(python2-config --prefix)/lib/libpython${python2_ver}.dylib") && \
        python3_ver=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))') &&                \
        CMAKE_OPT+=("-DPYTHON_INCLUDE_DIR:PATH=$(python3-config --prefix)/include/python${python3_ver}m") &&      \
        CMAKE_OPT+=("-DPYTHON_LIBRARY:FILEPATH=$(python3-config --prefix)/lib/libpython${python3_ver}.dylib")
      if [[ $(uname -r | cut -d "." -f 1) == 15 ]]; then plugins="${plugins};-CRYPTO"; fi
      ln -s /usr/local/opt/openssl/include/openssl/ /usr/local/include/openssl
    fi
  - >
    cmake
    -GNinja
    -DBUILD_STATIC=OFF
    -DPLUGINS="${plugins:-ALL}"
    -DBINDINGS=ALL
    -DENABLE_DEBUG=ON
    -DTOOLS=ALL
    -DINSTALL_SYSTEM_FILES=OFF
    -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
    -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR"
    -DKDB_DB_SYSTEM="$SYSTEM_DIR"
    ${CMAKE_OPT[@]}
    $TRAVIS_BUILD_DIR
  - export PATH=$PATH:"$INSTALL_DIR/bin"
  - export LD_LIBRARY_PATH="$INSTALL_DIR/lib"

script:
  - ninja
  - |
    if [[ "$FAST" == "ON" || "$ASAN" = "ON" ]]; then
      ninja run_all
    else
      ninja install
      ninja run_all
      kdb run_all
    fi
<commit_msg>Travis: Add build job for “full” version<commit_after>language: cpp

#
# Define the build matrix
#
matrix:
  include:

    - os: osx
      osx_image: xcode8.3
      compiler: clang
      env: [ FAST=ON ]

    - os: osx
      osx_image: xcode8.3
      compiler: clang
      env: [ ASAN=ON ]

    - os: linux
      compiler: clang
      env: [ ASAN=ON ]

    - os: linux
      compiler: gcc
      env: [ FULL=ON ]

    - os: osx
      osx_image: xcode8.3
      compiler: gcc

    - os: osx
      osx_image: xcode8.3
      compiler: clang

    - os: osx
      osx_image: xcode7.3
      compiler: clang

    - os: linux
      compiler: gcc

    - os: linux
      compiler: clang

before_install:
  - |
    if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
      brew update
      brew install ninja
    fi
  - |
    if [[ "$TRAVIS_OS_NAME" == "osx" && "$FAST" != "ON" ]]; then
      rvm install 2.3.1
      rvm use 2.3.1
      gem install test-unit --no-document
      if [[ "$CC" == "gcc" ]]; then
        brew install gcc
        brew link --overwrite gcc
        export CC=gcc-7
        export CXX=g++-7
        # Install yaml-cpp from source, since otherwise linking fails
        # We upgrade CMake and Boost first, since otherwise the last Homebrew command would install them from source too
        brew upgrade cmake; brew upgrade boost; brew install --cc=gcc-7 --c++11 yaml-cpp
      else
        # Linking the Homebrew versions of Botan and yaml-cpp using `gcc` fails on macOS
        brew install botan
        brew install yaml-cpp
        # Unfortunately Xerces 3.2 causes multiple problems if we translate Elektra with GCC on macOS
        brew install xerces-c
      fi
      brew install augeas
      brew install checkbashisms
      brew install dbus
      brew install discount
      brew install gobject-introspection
      brew install libgcrypt
      brew install libgit2
      brew install lua
      brew install openssl
      brew install python
      brew install python3
      brew install qt
      brew install swig
      brew install yajl
      pip2 install cheetah # Required by kdb-gen
      export Qt5_DIR=/usr/local/opt/qt5
    fi
  - |
    if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
      sudo apt-get -qq update
      sudo apt-get install clang-format-3.8
      sudo apt-get install ninja-build
      sudo apt-get install libboost-all-dev
      sudo apt-get install libyaml-cpp-dev
    fi

#
# Source is checked out in $TRAVIS_BUILD_DIR
# Build directory will be TRAVIS_BUILD_DIR/../build
#
before_script:
  - cd $TRAVIS_BUILD_DIR/..
  - >
    [[ "$TRAVIS_OS_NAME" == "linux" ]] && INSTALL_DIR="$PWD/install" || INSTALL_DIR="/usr/local"
  - SYSTEM_DIR="$PWD/kdbsystem"
  - mkdir build && cd build
  - >
    [[ $ASAN == ON ]] && CMAKE_OPT=(-DENABLE_ASAN=ON) || CMAKE_OPT=()
  - if [[ $FULL == ON ]]; then CMAKE_OPT+=(-DBUILD_FULL=ON); fi
  - |
    if [[ "$TRAVIS_OS_NAME" == "linux" && "$CC" == "clang" || "$TRAVIS_OS_NAME" == "osx" && "${CC:0:3}" == "gcc" ]]; then
      CMAKE_OPT+=("-DCOMMON_FLAGS=-Werror")
    fi
  - plugins="ALL;-jni"
  - |
    if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
      python2_ver=$(python2 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))') &&                  \
        CMAKE_OPT+=("-DPYTHON2_INCLUDE_DIR:PATH=$(python2-config --prefix)/include/python${python2_ver}") &&      \
        CMAKE_OPT+=("-DPYTHON2_LIBRARY:FILEPATH=$(python2-config --prefix)/lib/libpython${python2_ver}.dylib") && \
        python3_ver=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))') &&                \
        CMAKE_OPT+=("-DPYTHON_INCLUDE_DIR:PATH=$(python3-config --prefix)/include/python${python3_ver}m") &&      \
        CMAKE_OPT+=("-DPYTHON_LIBRARY:FILEPATH=$(python3-config --prefix)/lib/libpython${python3_ver}.dylib")
      if [[ $(uname -r | cut -d "." -f 1) == 15 ]]; then plugins="${plugins};-CRYPTO"; fi
      ln -s /usr/local/opt/openssl/include/openssl/ /usr/local/include/openssl
    fi
  - >
    cmake
    -GNinja
    -DBUILD_STATIC=OFF
    -DPLUGINS="${plugins:-ALL}"
    -DBINDINGS=ALL
    -DENABLE_DEBUG=ON
    -DTOOLS=ALL
    -DINSTALL_SYSTEM_FILES=OFF
    -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
    -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR"
    -DKDB_DB_SYSTEM="$SYSTEM_DIR"
    ${CMAKE_OPT[@]}
    $TRAVIS_BUILD_DIR
  - export PATH=$PATH:"$INSTALL_DIR/bin"
  - export LD_LIBRARY_PATH="$INSTALL_DIR/lib"

script:
  - ninja
  - |
    if [[ "$FAST" == "ON" || "$ASAN" = "ON" ]]; then
      ninja run_all
    else
      ninja install
      ninja run_all
      kdb run_all
    fi

{'fraction_non_alphanumeric': 0.13361541031065582, 'fraction_numerical': 0.011357309876405746, 'mean_word_length': 2.3565022421524664, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '6143614', 'n_tokens_mistral': 3290, 'n_tokens_neox': 3142, 'n_words': 746}