aboutsummaryrefslogtreecommitdiff
path: root/BuildScripts
diff options
context:
space:
mode:
authorGravatar thomasvl@gmail.com <thomasvl@gmail.com@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2008-07-09 21:19:26 +0000
committerGravatar thomasvl@gmail.com <thomasvl@gmail.com@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2008-07-09 21:19:26 +0000
commit6ddca07d6c48b0226550b6ff3e01a177b6afd6a5 (patch)
treeadbd23d96eacb322eb47a1c8c525bc4d2536dfc3 /BuildScripts
parent098f7782e376e818b131a8f9a8222056c63d51ee (diff)
- Added GTMSignalHandler for simple signal handling (via kqueue/runloop).
- Fixed up GTMIPhoneUnitTestDelegate to be pickier about which tests it runs - Added GTMNSString+URLArguments to GTMiPhone - Added GTMHTTPFetcher and GTMHTTPServer to GTMiPhone - Made sure that build would work with iPhone device attached, and that all tests run directly on the phone. - Added GTMValidatingContainers which are a set of mutable container classes that allow you to have a selector on a target that is called to verify that the objects being put into the container are valid. This can be controlled at compile time so that you don't take the performance hit in a release build. - Added GTMPath, which represents an existing absolute path on the file system. It also makes it very easy to contruct new paths in the file system as well as whole directory hierarchies. - Added GTMNSString+Replace for a common replacement need. - Added NSString+FindFolder for two commen helpers for building paths to common locations. - Added GTMLargeTypeWindow for doing display windows similar to Address Book Large Type display for phone numbers.
Diffstat (limited to 'BuildScripts')
-rwxr-xr-xBuildScripts/BuildAllSDKs.sh66
1 files changed, 41 insertions, 25 deletions
diff --git a/BuildScripts/BuildAllSDKs.sh b/BuildScripts/BuildAllSDKs.sh
index 0c9bbe8..0928dcd 100755
--- a/BuildScripts/BuildAllSDKs.sh
+++ b/BuildScripts/BuildAllSDKs.sh
@@ -2,8 +2,7 @@
# BuildAllSDKs.sh
#
# This script builds both the Tiger and Leopard versions of the requested
-# target in the current basic config (debug, release, debug-gcov). This script
-# should be run from the same directory as the GTM Xcode project file.
+# target in the current basic config (debug, release, debug-gcov).
#
# Copyright 2006-2008 Google Inc.
#
@@ -20,8 +19,9 @@
# the License.
PROJECT_TARGET="$1"
+STARTING_TARGET="${TARGET_NAME}"
+SCRIPT_APP="${TMPDIR}DoBuild.app"
-XCODEBUILD="${DEVELOPER_BIN_DIR}/xcodebuild"
REQUESTED_BUILD_STYLE=$(echo "${BUILD_STYLE}" | sed "s/.*OrLater-\(.*\)/\1/")
# See if we were told to clean instead of build.
PROJECT_ACTION="build"
@@ -29,26 +29,42 @@ if [ "${ACTION}" == "clean" ]; then
PROJECT_ACTION="clean"
fi
-# helper for doing a build
-function doIt {
- local myProject=$1
- local myTarget=$2
- local myConfig=$3
- echo "note: Starting ${PROJECT_ACTION} of ${myTarget} from ${myProject} in ${myConfig}"
- ${XCODEBUILD} -project "${myProject}" \
- -target "${myTarget}" \
- -configuration "${myConfig}" \
- "${PROJECT_ACTION}"
- buildResult=$?
- if [ $buildResult -ne 0 ]; then
- echo "Error: ** ${PROJECT_ACTION} Failed **"
- exit $buildResult
- fi
- echo "note: Done ${PROJECT_ACTION}"
-}
+# build up our AppleScript
+OUR_BUILD_SCRIPT="on run
+ tell application \"Xcode\"
+ activate
+ tell project \"GTM\"
+ -- wait for build to finish
+ set x to 0
+ repeat while currently building
+ delay 0.5
+ set x to x + 1
+ if x > 6 then
+ display alert \"GTM is still building, can't start.\"
+ return
+ end if
+ end repeat
+ -- do the build
+ with timeout of 9999 seconds
+ set active target to target \"${PROJECT_TARGET}\"
+ set buildResult to ${PROJECT_ACTION} using build configuration \"TigerOrLater-${REQUESTED_BUILD_STYLE}\"
+ if buildResult is not equal to \"Build succeeded\" then
+ set active target to target \"${STARTING_TARGET}\"
+ return
+ end if
+ -- do not need the result since we are not doing another build
+ ${PROJECT_ACTION} using build configuration \"LeopardOrLater-${REQUESTED_BUILD_STYLE}\"
+ set active target to target \"${STARTING_TARGET}\"
+ end timeout
+ end tell
+ end tell
+end run"
-# now build tiger and then leopard
-doIt GTM.xcodeproj "${PROJECT_TARGET}" "TigerOrLater-${REQUESTED_BUILD_STYLE}"
-doIt GTM.xcodeproj "${PROJECT_TARGET}" "LeopardOrLater-${REQUESTED_BUILD_STYLE}"
-
-# TODO(iphone if right tool chain?)
+# Xcode won't actually let us spawn this and run it w/ osascript because it
+# watches and waits for everything we have spawned to exit before the build is
+# considered done, so instead we compile this to a script app, and then use
+# open to invoke it, there by escaping our little sandbox.
+# xcode defeats this: ( echo "${OUR_BUILD_SCRIPT}" | osascript - & )
+rm -rf "${SCRIPT_APP}"
+echo "${OUR_BUILD_SCRIPT}" | osacompile -o "${SCRIPT_APP}" -x
+open "${SCRIPT_APP}"