From 2eee7cfb7d1916ec261b4619112db73e2998494e Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Thu, 15 Oct 2015 14:52:24 -0700 Subject: [PATCH 1/3] Support osx on Travis --- .travis.yml | 15 ++++++++++----- buildscripts/make_dependencies.sh | 6 +++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index b8b2d34a263..8b78abc88f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,11 +21,16 @@ before_script: after_success: - ./gradlew :grpc-all:coveralls -jdk: - - oraclejdk8 - -os: - - linux +# Use matrix to work around https://github.com/travis-ci/travis-ci/issues/3975 +# This also works around https://github.com/travis-ci/travis-ci/issues/2317 , +# but that is easy to work around by manually calling jdk_switcher if on linux +matrix: + include: + - os: linux + jdk: oraclejdk8 + - os: osx + # This image comes with jdk8 + osx_image: xcode7 notifications: email: false diff --git a/buildscripts/make_dependencies.sh b/buildscripts/make_dependencies.sh index 90cc64e0f1e..85a315091bf 100755 --- a/buildscripts/make_dependencies.sh +++ b/buildscripts/make_dependencies.sh @@ -29,7 +29,11 @@ if [ -f ${INSTALL_DIR}/lib/libssl.so ]; then else wget -O - https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz | tar xz -C $DOWNLOAD_DIR pushd $DOWNLOAD_DIR/openssl-${OPENSSL_VERSION} - ./Configure linux-x86_64 shared no-ssl2 no-comp --prefix=${INSTALL_DIR} + if [ "$(uname)" = Linux ]; then + ./Configure linux-x86_64 shared no-ssl2 no-comp --prefix=${INSTALL_DIR} + else + ./Configure darwin64-x86_64-cc shared no-ssl2 no-comp --prefix=${INSTALL_DIR} + fi make -j$(nproc) make install popd From 03c8bd0f12860911b91d9afac15ba3786d9c9e05 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Thu, 15 Oct 2015 16:32:31 -0700 Subject: [PATCH 2/3] try it --- .travis.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8b78abc88f0..8a6be2c7cda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,8 @@ env: - LD_LIBRARY_PATH=/tmp/protobuf-${PROTOBUF_VERSION}/lib:/tmp/openssl-${OPENSSL_VERSION}/lib before_install: + # Work around https://github.com/travis-ci/travis-ci/issues/2317 + - if \[ "$TRAVIS_OS_NAME" = linux \]; then jdk_switcher use oraclejdk8; fi - buildscripts/make_dependencies.sh # build protoc into /tmp/protobuf-${PROTOBUF_VERSION} - mkdir -p $HOME/.gradle - echo "checkstyle.ignoreFailures=false" >> $HOME/.gradle/gradle.properties @@ -21,16 +23,12 @@ before_script: after_success: - ./gradlew :grpc-all:coveralls -# Use matrix to work around https://github.com/travis-ci/travis-ci/issues/3975 -# This also works around https://github.com/travis-ci/travis-ci/issues/2317 , -# but that is easy to work around by manually calling jdk_switcher if on linux -matrix: - include: - - os: linux - jdk: oraclejdk8 - - os: osx - # This image comes with jdk8 - osx_image: xcode7 +os: + - linux + - osx + +# This image comes with jdk8 +osx_image: xcode7 notifications: email: false From 46437efb5f44a807c190a7efe2c29edaeab246a2 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Thu, 15 Oct 2015 16:55:45 -0700 Subject: [PATCH 3/3] moar --- .travis.yml | 6 ++++-- buildscripts/make_dependencies.sh | 8 +++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8a6be2c7cda..4334f24e24b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,9 +11,11 @@ env: - LD_LIBRARY_PATH=/tmp/protobuf-${PROTOBUF_VERSION}/lib:/tmp/openssl-${OPENSSL_VERSION}/lib before_install: - # Work around https://github.com/travis-ci/travis-ci/issues/2317 + # Work around https://github.com/travis-ci/travis-ci/issues/2317 - if \[ "$TRAVIS_OS_NAME" = linux \]; then jdk_switcher use oraclejdk8; fi - - buildscripts/make_dependencies.sh # build protoc into /tmp/protobuf-${PROTOBUF_VERSION} + - if \[ "$TRAVIS_OS_NAME" = osx \]; then brew update; fi + # build protoc into /tmp/protobuf-${PROTOBUF_VERSION} + - buildscripts/make_dependencies.sh - mkdir -p $HOME/.gradle - echo "checkstyle.ignoreFailures=false" >> $HOME/.gradle/gradle.properties diff --git a/buildscripts/make_dependencies.sh b/buildscripts/make_dependencies.sh index 85a315091bf..52ce8a58ea2 100755 --- a/buildscripts/make_dependencies.sh +++ b/buildscripts/make_dependencies.sh @@ -26,14 +26,12 @@ INSTALL_DIR=/tmp/openssl-${OPENSSL_VERSION} if [ -f ${INSTALL_DIR}/lib/libssl.so ]; then echo "Not building openssl. Already built" +elif [ "$(uname)" = Darwin ]; then + brew install openssl else wget -O - https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz | tar xz -C $DOWNLOAD_DIR pushd $DOWNLOAD_DIR/openssl-${OPENSSL_VERSION} - if [ "$(uname)" = Linux ]; then - ./Configure linux-x86_64 shared no-ssl2 no-comp --prefix=${INSTALL_DIR} - else - ./Configure darwin64-x86_64-cc shared no-ssl2 no-comp --prefix=${INSTALL_DIR} - fi + ./Configure linux-x86_64 shared no-ssl2 no-comp --prefix=${INSTALL_DIR} make -j$(nproc) make install popd