OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 set -e | 7 set -e |
8 | 8 |
9 # Pull off the optional args | 9 # Pull off the optional args |
10 USE_BREAKPAD=0 | 10 USE_BREAKPAD=0 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 # So, we work around all of this by making a script build phase that will run | 58 # So, we work around all of this by making a script build phase that will run |
59 # during the app build, and simply update the info.plist in place. This way | 59 # during the app build, and simply update the info.plist in place. This way |
60 # by the time the app target is done, the info.plist is correct. | 60 # by the time the app target is done, the info.plist is correct. |
61 # | 61 # |
62 | 62 |
63 TOP="${SRCROOT}/.." | 63 TOP="${SRCROOT}/.." |
64 BUILD_BRANDING=$1 | 64 BUILD_BRANDING=$1 |
65 | 65 |
66 set -x | 66 set -x |
67 | 67 |
68 SRC_APP_PATH="${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}" | |
69 | |
70 if [ "${USE_SVN}" = "1" ] ; then | 68 if [ "${USE_SVN}" = "1" ] ; then |
71 # Visible in the about:version page. | 69 # Visible in the about:version page. |
72 SVN_INFO=$(svn info "${TOP}" 2>/dev/null || true) | 70 SVN_INFO=$(svn info "${TOP}" 2>/dev/null || true) |
73 SVN_REVISION=$(echo "${SVN_INFO}" | sed -Ene 's/^Revision: (.*)$/\1/p') | 71 SVN_REVISION=$(echo "${SVN_INFO}" | sed -Ene 's/^Revision: (.*)$/\1/p') |
74 if [ -z "${SVN_REVISION}" ] ; then | 72 if [ -z "${SVN_REVISION}" ] ; then |
75 GIT_INFO=$(git log -1 --grep=git-svn-id --format=%b 2>/dev/null || true) | 73 GIT_INFO=$(git log -1 --grep=git-svn-id --format=%b 2>/dev/null || true) |
76 SVN_REVISION=$(echo "${GIT_INFO}" | \ | 74 SVN_REVISION=$(echo "${GIT_INFO}" | \ |
77 sed -Ene 's/^git-svn-id: .*@([0-9]+).*$/\1/p') | 75 sed -Ene 's/^git-svn-id: .*@([0-9]+).*$/\1/p') |
78 # Finding the revision for git and svn has failed. | 76 # Finding the revision for git and svn has failed. |
79 if [ -z "${SVN_REVISION}" ] ; then | 77 if [ -z "${SVN_REVISION}" ] ; then |
(...skipping 16 matching lines...) Expand all Loading... |
96 fi | 94 fi |
97 fi | 95 fi |
98 fi | 96 fi |
99 | 97 |
100 # Pull in the Chrome version number. | 98 # Pull in the Chrome version number. |
101 . "${TOP}/chrome/VERSION" | 99 . "${TOP}/chrome/VERSION" |
102 FULL_VERSION="${MAJOR}.${MINOR}.${BUILD}.${PATCH}" | 100 FULL_VERSION="${MAJOR}.${MINOR}.${BUILD}.${PATCH}" |
103 | 101 |
104 # I really hate how "defaults" doesn't take a real pathname but instead insists | 102 # I really hate how "defaults" doesn't take a real pathname but instead insists |
105 # on appending ".plist" to everything. | 103 # on appending ".plist" to everything. |
106 INFO_PLIST_PATH="Contents/Info.plist" | |
107 TMP_INFO_PLIST_DEFAULTS="${TEMP_DIR}/Info" | 104 TMP_INFO_PLIST_DEFAULTS="${TEMP_DIR}/Info" |
108 TMP_INFO_PLIST="${TMP_INFO_PLIST_DEFAULTS}.plist" | 105 TMP_INFO_PLIST="${TMP_INFO_PLIST_DEFAULTS}.plist" |
109 cp "${SRC_APP_PATH}/${INFO_PLIST_PATH}" "${TMP_INFO_PLIST}" | 106 cp "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" "${TMP_INFO_PLIST}" |
110 | 107 |
111 # Save off the Subversion revision number and source root path in case they're | 108 # Save off the Subversion revision number and source root path in case they're |
112 # needed. | 109 # needed. |
113 if [ ! -z "${SVN_REVISION}" ] ; then | 110 if [ ! -z "${SVN_REVISION}" ] ; then |
114 defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ | 111 defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ |
115 SVNRevision -string "${SVN_REVISION}" | 112 SVNRevision -string "${SVN_REVISION}" |
116 else | 113 else |
117 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" SVNRevision || true | 114 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" SVNRevision || true |
118 fi | 115 fi |
119 if [ ! -z "${SVN_PATH}" ] ; then | 116 if [ ! -z "${SVN_PATH}" ] ; then |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 # Make sure the keys aren't there, || true to avoid errors if they aren't. | 169 # Make sure the keys aren't there, || true to avoid errors if they aren't. |
173 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" KSVersion || true | 170 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" KSVersion || true |
174 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" KSProductID || true | 171 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" KSProductID || true |
175 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" KSUpdateURL || true | 172 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" KSUpdateURL || true |
176 fi | 173 fi |
177 | 174 |
178 # Info.plist will work perfectly well in any plist format, but traditionally | 175 # Info.plist will work perfectly well in any plist format, but traditionally |
179 # applications use xml1 for this, so convert it back after whatever defaults | 176 # applications use xml1 for this, so convert it back after whatever defaults |
180 # might have done. | 177 # might have done. |
181 plutil -convert xml1 "${TMP_INFO_PLIST}" | 178 plutil -convert xml1 "${TMP_INFO_PLIST}" |
182 cp "${TMP_INFO_PLIST}" "${SRC_APP_PATH}/${INFO_PLIST_PATH}" | 179 cp "${TMP_INFO_PLIST}" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" |
183 | 180 |
184 # Clean up. | 181 # Clean up. |
185 rm -f "${TMP_INFO_PLIST}" | 182 rm -f "${TMP_INFO_PLIST}" |
OLD | NEW |