sudo: required
dist: trusty

language: cpp

compiler: gcc

# dependencies for building Poedit on old Ubuntu:
addons:
    apt:
        sources:
            - ubuntu-toolchain-r-test
            - sourceline: 'ppa:vslavik/poedit'
        packages:
            - gcc-6
            - g++-6
            - libexpat1-dev
            - libdb++-dev
            - libboost-dev
            - libboost-system-dev
            - libboost-regex-dev
            - libboost-thread-dev
            - libboost-iostreams-dev
            - liblucene++-dev
            - libicu-dev
            - libwxgtk3.0-dev
            - libgtk2.0-dev
            - libgtkspell-dev
            - libcld2-dev
            - libcpprest-dev
            - libsecret-1-dev

env:
    - REAL_CC='ccache gcc-6' REAL_CXX='ccache g++-6'

before_install:
    # work around Travis being difficult, see https://github.com/travis-ci/travis-ci/issues/6633
    - export CC="$REAL_CC" CXX="$REAL_CXX"
    # git submodules needed for Linux:
    - git submodule update --init deps/json deps/pugixml

script:
    - scripts/travis-check-translations.sh
    # don't build directly, create a tarball first and try building from that
    - ./bootstrap && ./configure && make dist && make distcheck

after_failure:
    - test -f Makefile || cat config.log

git:
    submodules: false

cache:
    apt: true
    ccache: true

deploy:
    provider: releases
    api_key:
        secure: fkelxNMcGoNY4MT30dEiEUE53cMkhtmr44Y7iSEkOGmfeG9ReUqVIk1nd7027iehzdhhcov57XwHg49KA+AWpQGvEbLkRNRazOxSGFL9o/P/Rzft/tvKP0sxcRF5RUVo0b5J5wlsIKSlbjDqGu9CM+G4eyK0D2jo/XPzsv9akKQ=
    skip_cleanup: true
    file: poedit-2.4.2.tar.gz
    on:
        repo: vslavik/poedit
        tags: true
        all_branches: true
