language: java cache: directories: $HOME/.gradle jdk: - oraclejdk8 - oraclejdk7 - openjdk7 before_install: pip install --user codecov before_script: # init GUI for tests that can't run headless - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" - sleep 3 script: ./gradlew build javadoc # Release the plugin via GitHub releases when pushing a tag before_deploy: 'cp -T build/libs/josm-mapillary-plugin.jar build/libs/Mapillary.jar' deploy: provider: releases api_key: "${GH_TOKEN}" file: "build/libs/Mapillary.jar" skip_cleanup: true on: tags: true #Deploy to GitHub pages after_script: | if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ]; then git config --global user.email "deploy@travis" git config --global user.name "Travis CI" git remote add deploy "https://floscher:${GH_TOKEN}@github.com/floscher/josm-mapillary-plugin.git" git fetch --depth=1 origin gh-pages:gh-pages git checkout gh-pages git rm -r reports/ docs/ mkdir -p reports/ docs/ cp -R build/docs/javadoc/ docs/javadoc/ cp -R build/reports/tests/ reports/junit/ cp -R build/reports/jacoco/ reports/jacoco/ cp -R build/reports/findbugs/ reports/findbugs/ git stage docs/ reports/ masterCommit=`git rev-parse master` git commit -m "Publish developer resources to GitHub pages These resources are generated by Travis CI for commit $masterCommit using Gradle." git push --quiet deploy gh-pages 1>/dev/null 2>&1 fi after_success: codecov