Louis Ryan | c42c8c4 | 2015-03-18 16:31:38 -0700 | [diff] [blame] | 1 | sudo: false |
| 2 | |
Louis Ryan | 540b4d3 | 2015-09-04 13:26:24 -0700 | [diff] [blame] | 3 | language: java |
Louis Ryan | c42c8c4 | 2015-03-18 16:31:38 -0700 | [diff] [blame] | 4 | |
| 5 | env: |
| 6 | global: |
Eric Anderson | 56dca03 | 2016-02-12 08:48:41 -0800 | [diff] [blame] | 7 | - GRADLE_OPTS=-Xmx512m |
Eric Anderson | dbef1af | 2016-05-23 12:05:41 -0700 | [diff] [blame] | 8 | - PROTOBUF_VERSION=3.0.0-beta-3 |
Eric Anderson | 80f73a4 | 2016-04-27 15:23:35 -0700 | [diff] [blame] | 9 | - LDFLAGS=-L/tmp/protobuf/lib |
| 10 | - CXXFLAGS=-I/tmp/protobuf/include |
| 11 | - LD_LIBRARY_PATH=/tmp/protobuf/lib |
Louis Ryan | c42c8c4 | 2015-03-18 16:31:38 -0700 | [diff] [blame] | 12 | |
Eric Anderson | a0acb9b | 2015-03-20 10:26:00 -0700 | [diff] [blame] | 13 | before_install: |
Eric Anderson | 1d7a11c | 2016-04-29 15:07:22 -0700 | [diff] [blame] | 14 | - mkdir -p $HOME/.gradle/caches && |
| 15 | ln -s /tmp/gradle-caches-modules-2 $HOME/.gradle/caches/modules-2 |
| 16 | - mkdir -p $HOME/.gradle && |
| 17 | ln -s /tmp/gradle-wrapper $HOME/.gradle/wrapper |
Eric Anderson | 6dc5e80 | 2015-10-15 14:52:24 -0700 | [diff] [blame] | 18 | # Work around https://github.com/travis-ci/travis-ci/issues/2317 |
| 19 | - if \[ "$TRAVIS_OS_NAME" = linux \]; then jdk_switcher use oraclejdk8; fi |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 20 | - buildscripts/make_dependencies.sh # build protoc into /tmp/protobuf-${PROTOBUF_VERSION} |
Eric Anderson | 80f73a4 | 2016-04-27 15:23:35 -0700 | [diff] [blame] | 21 | - ln -s "/tmp/protobuf-${PROTOBUF_VERSION}/$(uname -s)-$(uname -p)" /tmp/protobuf |
Eric Anderson | 26141b4 | 2015-03-21 10:59:17 -0700 | [diff] [blame] | 22 | - mkdir -p $HOME/.gradle |
| 23 | - echo "checkstyle.ignoreFailures=false" >> $HOME/.gradle/gradle.properties |
Eric Anderson | 3c03eb7 | 2016-07-10 11:40:12 -0700 | [diff] [blame] | 24 | - echo "failOnWarnings=true" >> $HOME/.gradle/gradle.properties |
Louis Ryan | c42c8c4 | 2015-03-18 16:31:38 -0700 | [diff] [blame] | 25 | |
Eric Anderson | cea8e8e | 2015-10-27 19:53:18 -0700 | [diff] [blame] | 26 | install: |
Eric Anderson | d7bf67e | 2016-06-24 18:18:06 -0700 | [diff] [blame] | 27 | - ./gradlew assemble generateTestProto install |
| 28 | - pushd examples && ./gradlew build && popd |
| 29 | - pushd examples && mvn verify && popd |
Eric Anderson | cea8e8e | 2015-10-27 19:53:18 -0700 | [diff] [blame] | 30 | |
Eric Anderson | 3457199 | 2015-05-07 17:00:44 -0700 | [diff] [blame] | 31 | before_script: |
| 32 | - test -z "$(git status --porcelain)" || (git status && echo Error Working directory is not clean. Forget to commit generated files? && false) |
| 33 | |
Eric Anderson | 6715f12 | 2016-02-13 14:43:38 -0800 | [diff] [blame] | 34 | script: |
| 35 | - ./gradlew check :grpc-all:jacocoTestReport |
| 36 | |
Eric Anderson | 522580d | 2015-08-07 18:02:31 -0700 | [diff] [blame] | 37 | after_success: |
Eric Anderson | 6dc5e80 | 2015-10-15 14:52:24 -0700 | [diff] [blame] | 38 | - if \[ "$TRAVIS_OS_NAME" = linux \]; then ./gradlew :grpc-all:coveralls; fi |
Eric Anderson | 6715f12 | 2016-02-13 14:43:38 -0800 | [diff] [blame] | 39 | - bash <(curl -s https://codecov.io/bash) |
Louis Ryan | c42c8c4 | 2015-03-18 16:31:38 -0700 | [diff] [blame] | 40 | |
| 41 | os: |
| 42 | - linux |
Eric Anderson | 6dc5e80 | 2015-10-15 14:52:24 -0700 | [diff] [blame] | 43 | - osx |
| 44 | |
| 45 | # This image comes with jdk8 |
| 46 | osx_image: xcode7 |
Louis Ryan | c42c8c4 | 2015-03-18 16:31:38 -0700 | [diff] [blame] | 47 | |
Louis Ryan | c42c8c4 | 2015-03-18 16:31:38 -0700 | [diff] [blame] | 48 | notifications: |
Eric Anderson | a0acb9b | 2015-03-20 10:26:00 -0700 | [diff] [blame] | 49 | email: false |
| 50 | |
Eric Anderson | 6dc5e80 | 2015-10-15 14:52:24 -0700 | [diff] [blame] | 51 | # Caching does not work for public repositories with OS X: |
| 52 | # https://github.com/travis-ci/travis-ci/issues/4011 |
Eric Anderson | a0acb9b | 2015-03-20 10:26:00 -0700 | [diff] [blame] | 53 | cache: |
| 54 | directories: |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 55 | - /tmp/protobuf-${PROTOBUF_VERSION} |
Eric Anderson | 1d7a11c | 2016-04-29 15:07:22 -0700 | [diff] [blame] | 56 | - /tmp/gradle-caches-modules-2 |
| 57 | - /tmp/gradle-wrapper |
Eric Anderson | 1605578 | 2015-03-20 12:03:48 -0700 | [diff] [blame] | 58 | |
| 59 | before_cache: |
Eric Anderson | 1d7a11c | 2016-04-29 15:07:22 -0700 | [diff] [blame] | 60 | # The lock changes based on folder name; normally $HOME/.gradle/caches/modules-2/modules-2.lock |
| 61 | - rm /tmp/gradle-caches-modules-2/gradle-caches-modules-2.lock |
Eric Anderson | 3b54ffa | 2015-04-29 07:56:04 -0700 | [diff] [blame] | 62 | - find $HOME/.gradle/wrapper -not -name "*-all.zip" -and -not -name "*-bin.zip" -delete |