Browse Source

Merge pull request #2473 from thomasvl/update_xcodes

Update xcode version support and travis usage
Thomas Van Lenten 8 years ago
parent
commit
e43f73e099
3 changed files with 43 additions and 10 deletions
  1. 5 1
      .travis.yml
  2. 23 4
      objectivec/DevTools/full_mac_build.sh
  3. 15 5
      tests.sh

+ 5 - 1
.travis.yml

@@ -8,7 +8,7 @@ language: cpp
 os:
   - osx
 # The Objective C build needs Xcode 7.0 or later.
-osx_image: xcode8
+osx_image: xcode8.1
 script:
   - ./tests.sh $CONFIG
 env:
@@ -73,6 +73,10 @@ matrix:
     # we moved to an OS X image that is 10.11.
     - os: osx
       env: CONFIG=python_cpp
+    # This started failing with the OS X 10.12 / Xcode 8.1 image.
+    # https://github.com/google/protobuf/issues/2472
+    - os: osx
+      env: CONFIG=objectivec_cocoapods_integration
     # Mark the iOS test as flakey as xcodebuild some times fails to start the
     # iOS Simulator.
     - os: osx

+ 23 - 4
objectivec/DevTools/full_mac_build.sh

@@ -45,6 +45,8 @@ OPTIONS:
          Skip the invoke of Xcode to test the runtime on OS X.
    --skip-objc-conformance
          Skip the Objective C conformance tests (run on OS X).
+   --xcode-quiet
+         Pass -quiet to xcodebuild.
 
 EOF
 }
@@ -83,6 +85,7 @@ DO_XCODE_OSX_TESTS=yes
 DO_XCODE_DEBUG=yes
 DO_XCODE_RELEASE=yes
 DO_OBJC_CONFORMANCE_TESTS=yes
+XCODE_QUIET=no
 while [[ $# != 0 ]]; do
   case "${1}" in
     -h | --help )
@@ -124,6 +127,9 @@ while [[ $# != 0 ]]; do
     --skip-objc-conformance )
       DO_OBJC_CONFORMANCE_TESTS=no
       ;;
+    --xcode-quiet )
+      XCODE_QUIET=yes
+      ;;
     -*)
       echo "ERROR: Unknown option: ${1}" 1>&2
       printUsage
@@ -217,17 +223,21 @@ if ! objectivec/DevTools/pddm.py --dry-run objectivec/*.[hm] objectivec/Tests/*.
   exit 1
 fi
 
+readonly XCODE_VERSION_LINE="$(xcodebuild -version | grep Xcode\  )"
+readonly XCODE_VERSION="${XCODE_VERSION_LINE/Xcode /}"  # drop the prefix.
+
 if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then
   XCODEBUILD_TEST_BASE_IOS=(
     xcodebuild
       -project objectivec/ProtocolBuffers_iOS.xcodeproj
       -scheme ProtocolBuffers
   )
+  if [[ "${XCODE_QUIET}" == "yes" ]] ; then
+    XCODEBUILD_TEST_BASE_IOS+=( -quiet )
+  fi
   # Don't need to worry about form factors or retina/non retina;
   # just pick a mix of OS Versions and 32/64 bit.
   # NOTE: Different Xcode have different simulated hardware/os support.
-  readonly XCODE_VERSION_LINE="$(xcodebuild -version | grep Xcode\  )"
-  readonly XCODE_VERSION="${XCODE_VERSION_LINE/Xcode /}"  # drop the prefix.
   case "${XCODE_VERSION}" in
     6.* )
       echo "ERROR: Xcode 6.3/6.4 no longer supported for building, please use 8.0 or higher." 1>&2
@@ -247,6 +257,14 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then
           -destination "platform=iOS Simulator,name=iPad Pro (9.7 inch),OS=10.0" # 64bit
       )
       ;;
+    8.1* )
+      XCODEBUILD_TEST_BASE_IOS+=(
+          -destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit
+          -destination "platform=iOS Simulator,name=iPhone 7,OS=10.1" # 64bit
+          -destination "platform=iOS Simulator,name=iPad 2,OS=8.1" # 32bit
+          -destination "platform=iOS Simulator,name=iPad Pro (9.7 inch),OS=10.1" # 64bit
+      )
+      ;;
     * )
       echo "Time to update the simulator targets for Xcode ${XCODE_VERSION}"
       exit 2
@@ -271,8 +289,9 @@ if [[ "${DO_XCODE_OSX_TESTS}" == "yes" ]] ; then
       # Since the ObjC 2.0 Runtime is required, 32bit OS X isn't supported.
       -destination "platform=OS X,arch=x86_64" # 64bit
   )
-  readonly XCODE_VERSION_LINE="$(xcodebuild -version | grep Xcode\  )"
-  readonly XCODE_VERSION="${XCODE_VERSION_LINE/Xcode /}"  # drop the prefix.
+  if [[ "${XCODE_QUIET}" == "yes" ]] ; then
+    XCODEBUILD_TEST_BASE_OSX+=( -quiet )
+  fi
   case "${XCODE_VERSION}" in
     6.* )
       echo "ERROR: Xcode 6.3/6.4 no longer supported for building, please use 8.0 or higher." 1>&2

+ 15 - 5
tests.sh

@@ -38,11 +38,21 @@ build_cpp() {
   make check -j2
   cd conformance && make test_cpp && cd ..
 
-  # Verify benchmarking code can build successfully.
-  git submodule init
-  git submodule update
-  cd third_party/benchmark && cmake -DCMAKE_BUILD_TYPE=Release && make && cd ../..
-  cd benchmarks && make && ./generate-datasets && cd ..
+  # The benchmark code depends on cmake, so test if it is installed before
+  # trying to do the build.
+  # NOTE: The travis macOS images say they have cmake, but the xcode8.1 image
+  # appears to be missing it: https://github.com/travis-ci/travis-ci/issues/6996
+  if [[ $(type cmake 2>/dev/null) ]]; then
+    # Verify benchmarking code can build successfully.
+    git submodule init
+    git submodule update
+    cd third_party/benchmark && cmake -DCMAKE_BUILD_TYPE=Release && make && cd ../..
+    cd benchmarks && make && ./generate-datasets && cd ..
+  else
+    echo ""
+    echo "WARNING: Skipping validation of the bench marking code, cmake isn't installed."
+    echo ""
+  fi
 }
 
 build_cpp_distcheck() {