aboutsummaryrefslogtreecommitdiff
path: root/objectivec/DevTools/full_mac_build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'objectivec/DevTools/full_mac_build.sh')
-rwxr-xr-xobjectivec/DevTools/full_mac_build.sh127
1 files changed, 85 insertions, 42 deletions
diff --git a/objectivec/DevTools/full_mac_build.sh b/objectivec/DevTools/full_mac_build.sh
index c38fce7c..ff51d9f0 100755
--- a/objectivec/DevTools/full_mac_build.sh
+++ b/objectivec/DevTools/full_mac_build.sh
@@ -27,15 +27,20 @@ OPTIONS:
-a, --autogen
Start by rerunning autogen & configure.
-r, --regenerate-descriptors
- The descriptor.proto is checked in generated, cause it to regenerate.
+ Run generate_descriptor_proto.sh to regenerate all the checked in
+ proto sources.
-j #, --jobs #
Force the number of parallel jobs (useful for debugging build issues).
+ --core-only
+ Skip some of the core protobuf build/checks to shorten the build time.
--skip-xcode
Skip the invoke of Xcode to test the runtime on both iOS and OS X.
--skip-xcode-ios
Skip the invoke of Xcode to test the runtime on iOS.
--skip-xcode-osx
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).
EOF
}
@@ -67,9 +72,11 @@ fi
DO_AUTOGEN=no
DO_CLEAN=no
-REGEN_CPP_DESCRIPTORS=no
+REGEN_DESCRIPTORS=no
+CORE_ONLY=no
DO_XCODE_IOS_TESTS=yes
DO_XCODE_OSX_TESTS=yes
+DO_OBJC_CONFORMANCE_TESTS=yes
while [[ $# != 0 ]]; do
case "${1}" in
-h | --help )
@@ -82,13 +89,16 @@ while [[ $# != 0 ]]; do
-a | --autogen )
DO_AUTOGEN=yes
;;
- -r | --regenerate-cpp-descriptors )
- REGEN_CPP_DESCRIPTORS=yes
+ -r | --regenerate-descriptors )
+ REGEN_DESCRIPTORS=yes
;;
-j | --jobs )
shift
NUM_MAKE_JOBS="${1}"
;;
+ --core-only )
+ CORE_ONLY=yes
+ ;;
--skip-xcode )
DO_XCODE_IOS_TESTS=no
DO_XCODE_OSX_TESTS=no
@@ -99,6 +109,9 @@ while [[ $# != 0 ]]; do
--skip-xcode-osx )
DO_XCODE_OSX_TESTS=no
;;
+ --skip-objc-conformance )
+ DO_OBJC_CONFORMANCE_TESTS=no
+ ;;
-*)
echo "ERROR: Unknown option: ${1}" 1>&2
printUsage
@@ -114,7 +127,7 @@ while [[ $# != 0 ]]; do
done
# Into the proto dir.
-pushd "${ProtoRootDir}"
+cd "${ProtoRootDir}"
# if no Makefile, force the autogen.
if [[ ! -f Makefile ]] ; then
@@ -124,7 +137,9 @@ fi
if [[ "${DO_AUTOGEN}" == "yes" ]] ; then
header "Running autogen & configure"
./autogen.sh
- ./configure CXXFLAGS="-mmacosx-version-min=10.9 -Wnon-virtual-dtor -Woverloaded-virtual -Wunused-const-variable -Wunused-function"
+ ./configure \
+ CPPFLAGS="-mmacosx-version-min=10.9 -Wunused-const-variable -Wunused-function" \
+ CXXFLAGS="-Wnon-virtual-dtor -Woverloaded-virtual"
fi
if [[ "${DO_CLEAN}" == "yes" ]] ; then
@@ -150,41 +165,29 @@ if [[ "${DO_CLEAN}" == "yes" ]] ; then
fi
fi
-if [[ "${REGEN_CPP_DESCRIPTORS}" == "yes" ]] ; then
- header "Regenerating the C++ descriptor sources."
+if [[ "${REGEN_DESCRIPTORS}" == "yes" ]] ; then
+ header "Regenerating the descriptor sources."
./generate_descriptor_proto.sh -j "${NUM_MAKE_JOBS}"
fi
-header "Building"
-# Can't issue these together, when fully parallel, something sometimes chokes
-# at random.
-wrapped_make -j "${NUM_MAKE_JOBS}" all
-wrapped_make -j "${NUM_MAKE_JOBS}" check
-
-header "Ensuring the ObjC descriptors are current."
-# Find the newest input file (protos, compiler, and the generator script).
-# (these patterns catch some extra stuff, but better to over sample than under)
-readonly NewestInput=$(find \
- src/google/protobuf/*.proto \
- src/.libs src/*.la src/protoc \
- objectivec/generate_descriptors_proto.sh \
- -type f -print0 \
- | xargs -0 stat -f "%m %N" \
- | sort -n | tail -n1 | cut -f2- -d" ")
-# Find the oldest output file.
-readonly OldestOutput=$(find \
- "${ProtoRootDir}/objectivec/google" \
- -type f -print0 \
- | xargs -0 stat -f "%m %N" \
- | sort -n -r | tail -n1 | cut -f2- -d" ")
-# If the newest input is newer than the oldest output, regenerate.
-if [[ "${NewestInput}" -nt "${OldestOutput}" ]] ; then
- echo ">> Newest input is newer than oldest output, regenerating."
- objectivec/generate_descriptors_proto.sh -j "${NUM_MAKE_JOBS}"
+if [[ "${CORE_ONLY}" == "yes" ]] ; then
+ header "Building core Only"
+ wrapped_make -j "${NUM_MAKE_JOBS}"
else
- echo ">> Newest input is older than oldest output, no need to regenerating."
+ header "Building"
+ # Can't issue these together, when fully parallel, something sometimes chokes
+ # at random.
+ wrapped_make -j "${NUM_MAKE_JOBS}" all
+ wrapped_make -j "${NUM_MAKE_JOBS}" check
+ # Fire off the conformance tests also.
+ cd conformance
+ wrapped_make -j "${NUM_MAKE_JOBS}" test_cpp
+ cd ..
fi
+# Ensure the WKT sources checked in are current.
+objectivec/generate_well_known_types.sh --check-only -j "${NUM_MAKE_JOBS}"
+
header "Checking on the ObjC Runtime Code"
objectivec/DevTools/pddm_tests.py
if ! objectivec/DevTools/pddm.py --dry-run objectivec/*.[hm] objectivec/Tests/*.[hm] ; then
@@ -199,19 +202,53 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then
xcodebuild
-project objectivec/ProtocolBuffers_iOS.xcodeproj
-scheme ProtocolBuffers
- # Don't need to worry about form factors or retina/non retina;
- # just pick a mix of OS Versions and 32/64 bit.
- -destination "platform=iOS Simulator,name=iPhone 4s,OS=7.1" # 32bit
- -destination "platform=iOS Simulator,name=iPhone 6,OS=8.4" # 64bit
- -destination "platform=iOS Simulator,name=iPad 2,OS=7.1" # 32bit
- -destination "platform=iOS Simulator,name=iPad Air,OS=8.4" # 64bit
)
+ # 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.
+ IOS_SIMULATOR_NAME="Simulator"
+ case "${XCODE_VERSION}" in
+ 6.* )
+ echo "ERROR: Xcode 6.3/6.4 no longer supported for building, please use 7.0 or higher." 1>&2
+ exit 10
+ ;;
+ 7.1* )
+ XCODEBUILD_TEST_BASE_IOS+=(
+ -destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit
+ -destination "platform=iOS Simulator,name=iPhone 6,OS=9.0" # 64bit
+ -destination "platform=iOS Simulator,name=iPad 2,OS=8.1" # 32bit
+ -destination "platform=iOS Simulator,name=iPad Air,OS=9.0" # 64bit
+ )
+ ;;
+ 7.3* )
+ XCODEBUILD_TEST_BASE_IOS+=(
+ -destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit
+ -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" # 64bit
+ -destination "platform=iOS Simulator,name=iPad 2,OS=8.1" # 32bit
+ -destination "platform=iOS Simulator,name=iPad Air,OS=9.3" # 64bit
+ )
+ ;;
+ 7.* )
+ XCODEBUILD_TEST_BASE_IOS+=(
+ -destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit
+ -destination "platform=iOS Simulator,name=iPhone 6,OS=9.2" # 64bit
+ -destination "platform=iOS Simulator,name=iPad 2,OS=8.1" # 32bit
+ -destination "platform=iOS Simulator,name=iPad Air,OS=9.2" # 64bit
+ )
+ ;;
+ * )
+ echo "Time to update the simulator targets for Xcode ${XCODE_VERSION}"
+ exit 2
+ ;;
+ esac
header "Doing Xcode iOS build/tests - Debug"
"${XCODEBUILD_TEST_BASE_IOS[@]}" -configuration Debug test
header "Doing Xcode iOS build/tests - Release"
"${XCODEBUILD_TEST_BASE_IOS[@]}" -configuration Release test
# Don't leave the simulator in the developer's face.
- killall "iOS Simulator"
+ killall "${IOS_SIMULATOR_NAME}"
fi
if [[ "${DO_XCODE_OSX_TESTS}" == "yes" ]] ; then
XCODEBUILD_TEST_BASE_OSX=(
@@ -226,3 +263,9 @@ if [[ "${DO_XCODE_OSX_TESTS}" == "yes" ]] ; then
header "Doing Xcode OS X build/tests - Release"
"${XCODEBUILD_TEST_BASE_OSX[@]}" -configuration Release test
fi
+
+if [[ "${DO_OBJC_CONFORMANCE_TESTS}" == "yes" ]] ; then
+ cd conformance
+ wrapped_make -j "${NUM_MAKE_JOBS}" test_objc
+ cd ..
+fi