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

Side by Side Diff: build/mac/tweak_app_infoplist

Issue 115474: Rename official builds to "Google Chrome" on disk and "Chrome" in the menubar... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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
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 INCLUDE_BREAKPAD=0 10 INCLUDE_BREAKPAD=0
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 # the Info.plist has changed. So even if we updated it, it's only looking 47 # the Info.plist has changed. So even if we updated it, it's only looking
48 # at the modtime of the info.plist to see if that's changed. 48 # at the modtime of the info.plist to see if that's changed.
49 # 49 #
50 # So, we work around all of this by making a script build phase that will run 50 # So, we work around all of this by making a script build phase that will run
51 # during the app build, and simply update the info.plist in place. This way 51 # during the app build, and simply update the info.plist in place. This way
52 # by the time the app target is done, the info.plist is correct. 52 # by the time the app target is done, the info.plist is correct.
53 # 53 #
54 54
55 TOP="${SRCROOT}/.." 55 TOP="${SRCROOT}/.."
56 BUILD_BRANDING=$1 56 BUILD_BRANDING=$1
57 SRC_APP_PATH="${BUILT_PRODUCTS_DIR}/${BUILD_BRANDING}.app" 57 if [ "${BUILD_BRANDING}" == "Chromium" ]; then
58 APP_NAME="Chromium"
59 elif [ "${BUILD_BRANDING}" == "Chrome" ]; then
60 APP_NAME="Google Chrome"
61 else
62 echo "error: unknown branding: ${BUILD_BRANDING}" >&2
63 exit 1
64 fi
65 SRC_APP_PATH="${BUILT_PRODUCTS_DIR}/${APP_NAME}.app"
58 66
59 set -x 67 set -x
60 68
61 # Figure out what version this build corresponds to. Just use the svn revision 69 # Figure out what version this build corresponds to. Just use the svn revision
62 # for now. Warning: my svnversion returns 10495:10552M. But that's ok since 70 # for now. Warning: my svnversion returns 10495:10552M. But that's ok since
63 # it is just for reference. 71 # it is just for reference.
64 SVN_REVISION=$(svnversion "${SRCROOT}") 72 SVN_REVISION=$(svnversion "${SRCROOT}")
65 if [ -z "${SVN_REVISION}" ] ; then 73 if [ -z "${SVN_REVISION}" ] ; then
66 echo "warning: could not determine svn revision" >&2 74 echo "warning: could not determine svn revision" >&2
67 fi 75 fi
(...skipping 10 matching lines...) Expand all
78 BRANDING_FILE="${TOP}/chrome/app/theme/google_chrome/BRANDING" 86 BRANDING_FILE="${TOP}/chrome/app/theme/google_chrome/BRANDING"
79 else 87 else
80 echo "error: unknown branding: ${BUILD_BRANDING}" >&2 88 echo "error: unknown branding: ${BUILD_BRANDING}" >&2
81 exit 1 89 exit 1
82 fi 90 fi
83 COPYRIGHT_STRING=$(sed -n -e 's/^COPYRIGHT=\(.*\)$/\1/p' "${BRANDING_FILE}") 91 COPYRIGHT_STRING=$(sed -n -e 's/^COPYRIGHT=\(.*\)$/\1/p' "${BRANDING_FILE}")
84 # Map (c) or (C) to the copyright sign 92 # Map (c) or (C) to the copyright sign
85 COPYRIGHT_STRING=$(echo "${COPYRIGHT_STRING}" | sed -e $'s/([cC])/\302\251/g') 93 COPYRIGHT_STRING=$(echo "${COPYRIGHT_STRING}" | sed -e $'s/([cC])/\302\251/g')
86 94
87 # Build the full copyright string 95 # Build the full copyright string
88 LONG_COPYRIGHT="${BUILD_BRANDING} ${FULL_VERSION}, ${COPYRIGHT_STRING}" 96 LONG_COPYRIGHT="${APP_NAME} ${FULL_VERSION}, ${COPYRIGHT_STRING}"
89 97
90 # I really hate how "defaults" doesn't take a real pathname but instead insists 98 # I really hate how "defaults" doesn't take a real pathname but instead insists
91 # on appending ".plist" to everything. 99 # on appending ".plist" to everything.
92 INFO_PLIST_PATH="Contents/Info.plist" 100 INFO_PLIST_PATH="Contents/Info.plist"
93 TMP_INFO_PLIST_DEFAULTS="${TEMP_DIR}/Info" 101 TMP_INFO_PLIST_DEFAULTS="${TEMP_DIR}/Info"
94 TMP_INFO_PLIST="${TMP_INFO_PLIST_DEFAULTS}.plist" 102 TMP_INFO_PLIST="${TMP_INFO_PLIST_DEFAULTS}.plist"
95 cp "${SRC_APP_PATH}/${INFO_PLIST_PATH}" "${TMP_INFO_PLIST}" 103 cp "${SRC_APP_PATH}/${INFO_PLIST_PATH}" "${TMP_INFO_PLIST}"
96 104
97 # Save off the svn version number in case we need it 105 # Save off the svn version number in case we need it
98 defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ 106 defaults write "${TMP_INFO_PLIST_DEFAULTS}" \
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" BreakpadSendAndExit || true 147 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" BreakpadSendAndExit || true
140 # TODO: remove/update this when we have first launch 148 # TODO: remove/update this when we have first launch
141 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" BreakpadSkipConfirm || true 149 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" BreakpadSkipConfirm || true
142 fi 150 fi
143 151
144 # Info.plist will work perfectly well in any plist format, but traditionally 152 # Info.plist will work perfectly well in any plist format, but traditionally
145 # applications use xml1 for this, so convert it back after whatever defaults 153 # applications use xml1 for this, so convert it back after whatever defaults
146 # might have done. 154 # might have done.
147 plutil -convert xml1 "${TMP_INFO_PLIST}" 155 plutil -convert xml1 "${TMP_INFO_PLIST}"
148 cp "${TMP_INFO_PLIST}" "${SRC_APP_PATH}/${INFO_PLIST_PATH}" 156 cp "${TMP_INFO_PLIST}" "${SRC_APP_PATH}/${INFO_PLIST_PATH}"
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698