| 1 | sudo: required
|
|---|
| 2 | dist: trusty
|
|---|
| 3 | group: edge
|
|---|
| 4 |
|
|---|
| 5 | language: java
|
|---|
| 6 | cache:
|
|---|
| 7 | directories: $HOME/.gradle
|
|---|
| 8 | jdk:
|
|---|
| 9 | - oraclejdk9
|
|---|
| 10 | - oraclejdk8
|
|---|
| 11 | - openjdk8
|
|---|
| 12 | before_install: pip install --user codecov
|
|---|
| 13 | before_script: # init GUI for tests that can't run headless
|
|---|
| 14 | - "export DISPLAY=:99.0"
|
|---|
| 15 | - "sh -e /etc/init.d/xvfb start"
|
|---|
| 16 | - sleep 3
|
|---|
| 17 | script: ./gradlew build javadoc
|
|---|
| 18 |
|
|---|
| 19 | # Release the plugin via GitHub releases when pushing a tag
|
|---|
| 20 | before_deploy: 'cp -T build/libs/josm-mapillary-plugin.jar build/libs/Mapillary.jar'
|
|---|
| 21 | deploy:
|
|---|
| 22 | provider: releases
|
|---|
| 23 | api_key: "${GH_TOKEN}"
|
|---|
| 24 | file: "build/libs/Mapillary.jar"
|
|---|
| 25 | skip_cleanup: true
|
|---|
| 26 | on:
|
|---|
| 27 | tags: true
|
|---|
| 28 |
|
|---|
| 29 | # Deploy to GitHub pages
|
|---|
| 30 | after_script: |
|
|---|
| 31 | if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_JDK_VERSION" == "openjdk8" ]; then
|
|---|
| 32 | git config --global user.email "deploy@travis"
|
|---|
| 33 | git config --global user.name "Travis CI"
|
|---|
| 34 |
|
|---|
| 35 | # Prevent printout of credentials
|
|---|
| 36 | git config --global credential.helper store
|
|---|
| 37 | echo "https://${GH_USERNAME}:${GH_TOKEN}@github.com" > $HOME/.git-credentials
|
|---|
| 38 |
|
|---|
| 39 | git remote add deploy "https://github.com/floscher/josm-mapillary-plugin.git"
|
|---|
| 40 | git fetch --depth=1 origin gh-pages:gh-pages
|
|---|
| 41 | git checkout gh-pages
|
|---|
| 42 | git rm -r reports/ docs/
|
|---|
| 43 | mkdir -p reports/ docs/
|
|---|
| 44 | cp -R build/docs/javadoc/ docs/javadoc/
|
|---|
| 45 | cp -R build/reports/tests/ reports/junit/
|
|---|
| 46 | cp -R build/reports/jacoco/ reports/jacoco/
|
|---|
| 47 | cp -R build/reports/findbugs/ reports/findbugs/
|
|---|
| 48 | git stage docs/ reports/
|
|---|
| 49 | masterCommit=`git rev-parse master`
|
|---|
| 50 | git commit -m "Publish developer resources to GitHub pages
|
|---|
| 51 |
|
|---|
| 52 | These resources are generated by Travis CI for commit $masterCommit using Gradle."
|
|---|
| 53 | git push deploy gh-pages
|
|---|
| 54 | else
|
|---|
| 55 | echo "This is branch $TRAVIS_BRANCH with JDK $TRAVIS_JDK_VERSION, developer resources are only published with openjdk8 on branch master."
|
|---|
| 56 | fi
|
|---|
| 57 |
|
|---|
| 58 | after_success: codecov
|
|---|