Skip to content

Commit 6dc5e80

Browse files
committed
Support OS X on Travis
1 parent 17597ce commit 6dc5e80

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

.travis.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ env:
1111
- LD_LIBRARY_PATH=/tmp/protobuf-${PROTOBUF_VERSION}/lib:/tmp/openssl-${OPENSSL_VERSION}/lib
1212

1313
before_install:
14+
# Work around https://github.com/travis-ci/travis-ci/issues/2317
15+
- if \[ "$TRAVIS_OS_NAME" = linux \]; then jdk_switcher use oraclejdk8; fi
16+
- if \[ "$TRAVIS_OS_NAME" = osx \]; then brew update; fi
1417
- buildscripts/make_dependencies.sh # build protoc into /tmp/protobuf-${PROTOBUF_VERSION}
1518
- mkdir -p $HOME/.gradle
1619
- echo "checkstyle.ignoreFailures=false" >> $HOME/.gradle/gradle.properties
@@ -19,17 +22,20 @@ before_script:
1922
- test -z "$(git status --porcelain)" || (git status && echo Error Working directory is not clean. Forget to commit generated files? && false)
2023

2124
after_success:
22-
- ./gradlew :grpc-all:coveralls
23-
24-
jdk:
25-
- oraclejdk8
25+
- if \[ "$TRAVIS_OS_NAME" = linux \]; then ./gradlew :grpc-all:coveralls; fi
2626

2727
os:
2828
- linux
29+
- osx
30+
31+
# This image comes with jdk8
32+
osx_image: xcode7
2933

3034
notifications:
3135
email: false
3236

37+
# Caching does not work for public repositories with OS X:
38+
# https://github.com/travis-ci/travis-ci/issues/4011
3339
cache:
3440
directories:
3541
- /tmp/protobuf-${PROTOBUF_VERSION}

buildscripts/make_dependencies.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ mkdir -p $DOWNLOAD_DIR
1111
# Can't check for presence of directory as cache auto-creates it.
1212
if [ -f ${INSTALL_DIR}/bin/protoc ]; then
1313
echo "Not building protobuf. Already built"
14+
# TODO(ejona): swap to `brew install --devel protobuf` once it is up-to-date
1415
else
1516
wget -O - https://github.com/google/protobuf/archive/v${PROTOBUF_VERSION}.tar.gz | tar xz -C $DOWNLOAD_DIR
1617
pushd $DOWNLOAD_DIR/protobuf-${PROTOBUF_VERSION}
@@ -26,6 +27,8 @@ INSTALL_DIR=/tmp/openssl-${OPENSSL_VERSION}
2627

2728
if [ -f ${INSTALL_DIR}/lib/libssl.so ]; then
2829
echo "Not building openssl. Already built"
30+
elif [ "$(uname)" = Darwin ]; then
31+
brew install openssl
2932
else
3033
wget -O - https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz | tar xz -C $DOWNLOAD_DIR
3134
pushd $DOWNLOAD_DIR/openssl-${OPENSSL_VERSION}

0 commit comments

Comments
 (0)