diff --git a/script/bootstrap b/script/bootstrap index 84b7dd6..92d7d75 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -10,9 +10,12 @@ config () { # A whitespace-separated list of executables that must be present and locatable. # These will each be installed through Homebrew if not found. - : ${REQUIRED_TOOLS="xctool cmake libssh2 libtool autoconf automake pkg-config"} + : ${REQUIRED_TOOLS="cmake libssh2 libtool autoconf automake pkg-config"} + : ${REQUIRED_GEMS="xcpretty"} export REQUIRED_TOOLS + export REQUIRED_GEMS + } ## @@ -102,6 +105,11 @@ check_deps () sudo ln -s "$brew_prefix/$product" "$destination" done fi + + for gem in $REQUIRED_GEMS + do + gem install "$gem" + done } bootstrap_submodule () diff --git a/script/cibuild b/script/cibuild index 2369fb1..dff90b0 100755 --- a/script/cibuild +++ b/script/cibuild @@ -13,7 +13,7 @@ config () # The workspace to build. # # If not set and no workspace is found, the -workspace flag will not be passed - # to `xctool`. + # to `xcodebuild`. # # Only one of `XCWORKSPACE` and `XCODEPROJ` needs to be set. The former will # take precedence. @@ -22,7 +22,7 @@ config () # The project to build. # # If not set and no project is found, the -project flag will not be passed - # to `xctool`. + # to `xcodebuild`. # # Only one of `XCWORKSPACE` and `XCODEPROJ` needs to be set. The former will # take precedence. @@ -33,8 +33,8 @@ config () # If this file does not exist, it is not considered an error. : ${BOOTSTRAP="$SCRIPT_DIR/bootstrap"} - # Extra options to pass to xctool. - : ${XCTOOL_OPTIONS="RUN_CLANG_STATIC_ANALYZER=NO"} + # Extra options to pass to xcodebuild. + : ${XCODEBUILD_OPTIONS="RUN_CLANG_STATIC_ANALYZER=NO"} # A whitespace-separated list of default schemes to build. # @@ -44,7 +44,7 @@ config () export XCWORKSPACE export XCODEPROJ export BOOTSTRAP - export XCTOOL_OPTIONS + export XCODEBUILD_OPTIONS export SCHEMES } @@ -86,17 +86,17 @@ find_pattern () ls -d $1 2>/dev/null | head -n 1 } -run_xctool () +run_xcodebuild () { if [ -n "$XCWORKSPACE" ] then - xctool -workspace "$XCWORKSPACE" $XCTOOL_OPTIONS "$@" \ + xcodebuild -workspace "$XCWORKSPACE" $XCODEBUILD_OPTIONS "$@" \ ONLY_ACTIVE_ARCH=NO \ CODE_SIGN_IDENTITY="" \ CODE_SIGNING_REQUIRED=NO 2>&1 elif [ -n "$XCODEPROJ" ] then - xctool -project "$XCODEPROJ" $XCTOOL_OPTIONS "$@" \ + xcodebuild -project "$XCODEPROJ" $XCODEBUILD_OPTIONS "$@" \ ONLY_ACTIVE_ARCH=NO \ CODE_SIGN_IDENTITY="" \ CODE_SIGNING_REQUIRED=NO 2>&1 @@ -108,7 +108,7 @@ run_xctool () parse_build () { - awk -f "$SCRIPT_DIR/xctool.awk" 2>&1 >/dev/null + awk -f "$SCRIPT_DIR/xcodebuild.awk" 2>&1 >/dev/null } build_scheme () @@ -122,7 +122,7 @@ build_scheme () local action=test # Determine whether we can run unit tests for this target. - run_xctool -scheme "$scheme" run-tests | parse_build + run_xcodebuild -scheme "$scheme" test | parse_build local awkstatus=$? @@ -132,7 +132,7 @@ build_scheme () sdkflags=(-sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 5") # Determine whether the unit tests will run with iphonesimulator - run_xctool "${sdkflags[@]}" -scheme "$scheme" run-tests | parse_build + run_xcodebuild "${sdkflags[@]}" -scheme "$scheme" tests | parse_build awkstatus=$? @@ -149,11 +149,11 @@ build_scheme () action=build fi - run_xctool "${sdkflags[@]}" -scheme "$scheme" $action + run_xcodebuild "${sdkflags[@]}" -scheme "$scheme" $action | xcpretty } export -f build_scheme -export -f run_xctool +export -f run_xcodebuild export -f parse_build main diff --git a/script/xcodebuild.awk b/script/xcodebuild.awk index c746b09..7258554 100644 --- a/script/xcodebuild.awk +++ b/script/xcodebuild.awk @@ -13,23 +13,11 @@ BEGIN { fflush(stdout); } -/is not valid for Testing/ { - exit 2; -} - -/[0-9]+: (error|warning):/ { - errors = errors $0 "\n"; -} - -/(TEST|BUILD) FAILED/ { - status = 1; +/A build only device cannot be used to run this target/ { + status = 1 } END { - if (length(errors) > 0) { - print "\n*** All errors:\n" errors; - } - fflush(stdout); exit status; }