Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: test/mac/type_envvars/test_check_sdkroot.sh

Issue 82763006: Fix gyptest-type-envvars.py for Xcode 5.0.0 (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Improve comment of xcodeversion fn and add space around | Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/bin/bash
2 # Copyright (c) 2014 Google Inc. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 set -e
7
8 # `xcodebuild -version` output looks like
9 # Xcode 4.6.3
10 # Build version 4H1503
11 # or like
12 # Xcode 4.2
13 # Build version 4C199
14 # or like
15 # Xcode 3.2.6
16 # Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0
17 # BuildVersion: 10M2518
18 # Convert that to '0463', '0420' and '0326' respectively.
19 function xcodeversion() {
20 xcodebuild -version | awk '/Xcode ([0-9]+\.[0-9]+(\.[0-9]+)?)/ {
21 version = $2
22 gsub(/\./, "", version)
23 if (length(version) < 3) {
24 version = version "0"
25 }
26 if (length(version) < 4) {
27 version = "0" version
28 }
29 }
30 END { print version }'
31 }
32
33 # Returns true if |string1| is smaller than |string2|.
34 # This function assumes that both strings represent Xcode version numbers
35 # as returned by |xcodeversion|.
36 function smaller() {
37 local min="$(echo -ne "${1}\n${2}\n" | sort -n | head -n1)"
38 test "${min}" != "${2}"
39 }
40
41 if [[ "$(xcodeversion)" < "0500" ]]; then
42 # Xcode version is older than 5.0, check that SDKROOT is set but empty.
43 [[ -z "${SDKROOT}" && -z "${SDKROOT-_}" ]]
44 else
45 # Xcode version is newer than 5.0, check that SDKROOT is set.
46 [[ "${SDKROOT}" == "$(xcodebuild -version -sdk '' Path)" ]]
47 fi
OLDNEW
« no previous file with comments | « test/mac/type_envvars/test_bundle_shared_library.sh ('k') | test/mac/type_envvars/test_nonbundle_executable.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698