dist: xenial  
language: cpp
git:
  depth: false
matrix:
  include:
    - name: Linux GCC
      compiler: gcc
      os: linux
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-7
        sonarcloud:
          organization: "elnormous-github"
          token:
            secure: "L4nEr4rHuk4Le7jFQyAFNVsI+m7rsInUHPwhQMVPfUQq1gYdy2NzijLVY2Y/DMvmuxn0NgI/AN2b/FcY+qD8vWa4tz07BrRL5PAu+uISSQayVdKE7ELS8ENVrwGPIbpuk5RQpBVCpJOn1SbOmjSPcqHwfedLVt6cqAk/mCXbGBQd0As8YhGTDFwFtxXMD1TNwqpXCSLnUQKsatbtAb1BUH6erBCzTvFquevx70S/c0zv40gB1slla5MQwXrs14IQqJT05TQqJVgls5t4p+C4aZg0nZ3XRIGfpNyUkedod3cW7YW8UJX4brzFjqHyA2EiND3um9ov9aj7ZwRtmlavJs6w/cMS+eFBjAQmW3TZythe7oPYFZAc3c86KDQo0z9h836e7Sav/sGz/BvCpEa9ofTJJoROV8TobP2bWWFqoz0hPj3t8PDnuaoEuQeFdAh5ZjIuQ8OcGJrRMKoowqSWLiFs1XSUSvTU6f+Vhm7BWHuZc+FvmnpXxkJfG+0o4hzOSsQuspKhSrcy5bMJAi5rkxnkMheNKQBS8HZ6tpKwlJYVPX8gJQvfCwX6Z+Srfv22mPuWv/JpPG/NKPrxOHDa7aAQx6irGj+oDjucNmu0L9bkMhPuK3eNwtd6m0eoGAxDdq017gvY7EdczF00TbDNpwUDF4cqEeb7Fg5AQ5F48Tc="
      before_install:
        - sudo apt-get install -y libgl1-mesa-dev libgles2-mesa-dev libopenal-dev libasound2-dev libxi-dev libxcursor-dev libxrandr-dev libxss-dev
        - curl --insecure https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.3.0.2102-linux.zip -o sonar-scanner-cli-4.3.0.2102-linux.zip
        - unzip sonar-scanner-cli-4.3.0.2102-linux.zip -d ${TRAVIS_HOME}/.sonarscanner/
        - export PATH=${TRAVIS_HOME}/.sonarscanner/sonar-scanner-4.3.0.2102-linux/bin:$PATH
      before_script:
        - export CXX=g++-7
      script:
        - build-wrapper-linux-x86-64 --out-dir bw-output make -j2 -C samples/
        - sonar-scanner -D sonar.projectKey=Ouzel -D sonar.projectName="Ouzel Linux" || true
    - name: macOS
      compiler: clang
      os: osx
      osx_image: xcode10
      addons:
        sonarcloud:
          organization: "elnormous-github"
          token:
            secure: "L4nEr4rHuk4Le7jFQyAFNVsI+m7rsInUHPwhQMVPfUQq1gYdy2NzijLVY2Y/DMvmuxn0NgI/AN2b/FcY+qD8vWa4tz07BrRL5PAu+uISSQayVdKE7ELS8ENVrwGPIbpuk5RQpBVCpJOn1SbOmjSPcqHwfedLVt6cqAk/mCXbGBQd0As8YhGTDFwFtxXMD1TNwqpXCSLnUQKsatbtAb1BUH6erBCzTvFquevx70S/c0zv40gB1slla5MQwXrs14IQqJT05TQqJVgls5t4p+C4aZg0nZ3XRIGfpNyUkedod3cW7YW8UJX4brzFjqHyA2EiND3um9ov9aj7ZwRtmlavJs6w/cMS+eFBjAQmW3TZythe7oPYFZAc3c86KDQo0z9h836e7Sav/sGz/BvCpEa9ofTJJoROV8TobP2bWWFqoz0hPj3t8PDnuaoEuQeFdAh5ZjIuQ8OcGJrRMKoowqSWLiFs1XSUSvTU6f+Vhm7BWHuZc+FvmnpXxkJfG+0o4hzOSsQuspKhSrcy5bMJAi5rkxnkMheNKQBS8HZ6tpKwlJYVPX8gJQvfCwX6Z+Srfv22mPuWv/JpPG/NKPrxOHDa7aAQx6irGj+oDjucNmu0L9bkMhPuK3eNwtd6m0eoGAxDdq017gvY7EdczF00TbDNpwUDF4cqEeb7Fg5AQ5F48Tc="
      before_install:
        - curl --insecure https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.3.0.2102-macosx.zip -o sonar-scanner-cli-4.3.0.2102-macosx.zip
        - unzip sonar-scanner-cli-4.3.0.2102-macosx.zip -d ${TRAVIS_HOME}/.sonarscanner/
        - export PATH=${TRAVIS_HOME}/.sonarscanner/sonar-scanner-4.3.0.2102-macosx/bin:$PATH
      before_script:
        - export CXX=clang++
      script:
        - build-wrapper-macosx-x86 --out-dir bw-output make -j2 -C samples/
        - sonar-scanner -D sonar.projectKey=OuzelMacOS -D sonar.projectName="Ouzel macOS" || true
    - name: iOS
      compiler: clang
      os: osx
      osx_image: xcode10
      addons:
        sonarcloud:
          organization: "elnormous-github"
          token:
            secure: "L4nEr4rHuk4Le7jFQyAFNVsI+m7rsInUHPwhQMVPfUQq1gYdy2NzijLVY2Y/DMvmuxn0NgI/AN2b/FcY+qD8vWa4tz07BrRL5PAu+uISSQayVdKE7ELS8ENVrwGPIbpuk5RQpBVCpJOn1SbOmjSPcqHwfedLVt6cqAk/mCXbGBQd0As8YhGTDFwFtxXMD1TNwqpXCSLnUQKsatbtAb1BUH6erBCzTvFquevx70S/c0zv40gB1slla5MQwXrs14IQqJT05TQqJVgls5t4p+C4aZg0nZ3XRIGfpNyUkedod3cW7YW8UJX4brzFjqHyA2EiND3um9ov9aj7ZwRtmlavJs6w/cMS+eFBjAQmW3TZythe7oPYFZAc3c86KDQo0z9h836e7Sav/sGz/BvCpEa9ofTJJoROV8TobP2bWWFqoz0hPj3t8PDnuaoEuQeFdAh5ZjIuQ8OcGJrRMKoowqSWLiFs1XSUSvTU6f+Vhm7BWHuZc+FvmnpXxkJfG+0o4hzOSsQuspKhSrcy5bMJAi5rkxnkMheNKQBS8HZ6tpKwlJYVPX8gJQvfCwX6Z+Srfv22mPuWv/JpPG/NKPrxOHDa7aAQx6irGj+oDjucNmu0L9bkMhPuK3eNwtd6m0eoGAxDdq017gvY7EdczF00TbDNpwUDF4cqEeb7Fg5AQ5F48Tc="
      before_install:
        - curl --insecure https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.3.0.2102-macosx.zip -o sonar-scanner-cli-4.3.0.2102-macosx.zip
        - unzip sonar-scanner-cli-4.3.0.2102-macosx.zip -d ${TRAVIS_HOME}/.sonarscanner/
        - export PATH=${TRAVIS_HOME}/.sonarscanner/sonar-scanner-4.3.0.2102-macosx/bin:$PATH
      before_script:
        - export CXX=clang++
      script:
        - build-wrapper-macosx-x86 --out-dir bw-output make PLATFORM=ios -j2 -C samples/
        - sonar-scanner -D sonar.projectKey=OuzelIOS -D sonar.projectName="Ouzel iOS" || true
    - name: tvOS
      compiler: clang
      os: osx
      osx_image: xcode10
      addons:
        sonarcloud:
          organization: "elnormous-github"
          token:
            secure: "L4nEr4rHuk4Le7jFQyAFNVsI+m7rsInUHPwhQMVPfUQq1gYdy2NzijLVY2Y/DMvmuxn0NgI/AN2b/FcY+qD8vWa4tz07BrRL5PAu+uISSQayVdKE7ELS8ENVrwGPIbpuk5RQpBVCpJOn1SbOmjSPcqHwfedLVt6cqAk/mCXbGBQd0As8YhGTDFwFtxXMD1TNwqpXCSLnUQKsatbtAb1BUH6erBCzTvFquevx70S/c0zv40gB1slla5MQwXrs14IQqJT05TQqJVgls5t4p+C4aZg0nZ3XRIGfpNyUkedod3cW7YW8UJX4brzFjqHyA2EiND3um9ov9aj7ZwRtmlavJs6w/cMS+eFBjAQmW3TZythe7oPYFZAc3c86KDQo0z9h836e7Sav/sGz/BvCpEa9ofTJJoROV8TobP2bWWFqoz0hPj3t8PDnuaoEuQeFdAh5ZjIuQ8OcGJrRMKoowqSWLiFs1XSUSvTU6f+Vhm7BWHuZc+FvmnpXxkJfG+0o4hzOSsQuspKhSrcy5bMJAi5rkxnkMheNKQBS8HZ6tpKwlJYVPX8gJQvfCwX6Z+Srfv22mPuWv/JpPG/NKPrxOHDa7aAQx6irGj+oDjucNmu0L9bkMhPuK3eNwtd6m0eoGAxDdq017gvY7EdczF00TbDNpwUDF4cqEeb7Fg5AQ5F48Tc="
      before_install:
        - curl --insecure https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.3.0.2102-macosx.zip -o sonar-scanner-cli-4.3.0.2102-macosx.zip
        - unzip sonar-scanner-cli-4.3.0.2102-macosx.zip -d ${TRAVIS_HOME}/.sonarscanner/
        - export PATH=${TRAVIS_HOME}/.sonarscanner/sonar-scanner-4.3.0.2102-macosx/bin:$PATH
      before_script:
        - export CXX=clang++
      script:
        - build-wrapper-macosx-x86 --out-dir bw-output make PLATFORM=tvos -j2 -C samples/
        - sonar-scanner -D sonar.projectKey=OuzelTVOS -D sonar.projectName="Ouzel tvOS" || true
    - name: Android
      language: android
      android:
        components:
          - tools
          - platform-tools
          - tools
          - build-tools-26.0.0
          - android-26
      install:
        - yes | sdkmanager "ndk-bundle"
        - export ANDROID_NDK_HOME=/usr/local/android-sdk/ndk-bundle
      script:
        - $ANDROID_NDK_HOME/ndk-build -j2 -C samples/app/src/main/
    - name: Emscripten
      language: python
      python:
         - "3.6"
      before_install:
        - git clone https://github.com/emscripten-core/emsdk.git
        - cd emsdk/
        - ./emsdk install latest
        - ./emsdk activate latest
        - source ./emsdk_env.sh
        - cd ..
      before_script:
        - export NODE_OPTIONS=--max_old_space_size=8192
      script:
        - make PLATFORM=emscripten -j2 -C samples/