[32335] | 1 | sudo: required
|
---|
| 2 | dist: trusty
|
---|
| 3 | group: edge
|
---|
| 4 |
|
---|
[31393] | 5 | language: java
|
---|
[31407] | 6 | cache:
|
---|
| 7 | directories: $HOME/.gradle
|
---|
[31393] | 8 | jdk:
|
---|
[32335] | 9 | - oraclejdk9
|
---|
[31393] | 10 | - oraclejdk8
|
---|
[32335] | 11 | - openjdk8
|
---|
[31834] | 12 | before_install: pip install --user codecov
|
---|
[31821] | 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
|
---|
[31406] | 17 | script: ./gradlew build javadoc
|
---|
| 18 |
|
---|
[31408] | 19 | # Release the plugin via GitHub releases when pushing a tag
|
---|
[31818] | 20 | before_deploy: 'cp -T build/libs/josm-mapillary-plugin.jar build/libs/Mapillary.jar'
|
---|
[31408] | 21 | deploy:
|
---|
| 22 | provider: releases
|
---|
| 23 | api_key: "${GH_TOKEN}"
|
---|
[31818] | 24 | file: "build/libs/Mapillary.jar"
|
---|
[31408] | 25 | skip_cleanup: true
|
---|
| 26 | on:
|
---|
| 27 | tags: true
|
---|
| 28 |
|
---|
[32336] | 29 | # Deploy to GitHub pages
|
---|
[31818] | 30 | after_script: |
|
---|
[32336] | 31 | if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_JDK_VERSION" == "openjdk8" ]; then
|
---|
[31406] | 32 | git config --global user.email "deploy@travis"
|
---|
| 33 | git config --global user.name "Travis CI"
|
---|
[32336] | 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"
|
---|
[31406] | 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/
|
---|
[31407] | 47 | cp -R build/reports/findbugs/ reports/findbugs/
|
---|
[31406] | 48 | git stage docs/ reports/
|
---|
| 49 | masterCommit=`git rev-parse master`
|
---|
| 50 | git commit -m "Publish developer resources to GitHub pages
|
---|
[31407] | 51 |
|
---|
| 52 | These resources are generated by Travis CI for commit $masterCommit using Gradle."
|
---|
[32336] | 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."
|
---|
[31406] | 56 | fi
|
---|
[31834] | 57 |
|
---|
| 58 | after_success: codecov
|
---|