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

Side by Side Diff: build/mac/tweak_app_infoplist

Issue 113555: Adding a general script to fetch values from the BRANDING files. (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
« build/mac/build_app_dmg ('K') | « build/mac/dump_app_syms ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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"
66 57
67 set -x 58 set -x
68 59
60 BRAND_SCRIPT="${TOP}/build/branding_value.sh"
Mark Mentovai 2009/05/19 13:57:14 -x section?
61 APP_NAME=$("${BRAND_SCRIPT}" "${BUILD_BRANDING}" PRODUCT_FULLNAME)
62 SRC_APP_PATH="${BUILT_PRODUCTS_DIR}/${APP_NAME}.app"
63
69 # Figure out what version this build corresponds to. Just use the svn revision 64 # Figure out what version this build corresponds to. Just use the svn revision
70 # for now. Warning: my svnversion returns 10495:10552M. But that's ok since 65 # for now. Warning: my svnversion returns 10495:10552M. But that's ok since
71 # it is just for reference. 66 # it is just for reference.
72 SVN_REVISION=$(svnversion "${SRCROOT}") 67 SVN_REVISION=$(svnversion "${SRCROOT}")
73 if [ -z "${SVN_REVISION}" ] ; then 68 if [ -z "${SVN_REVISION}" ] ; then
74 echo "warning: could not determine svn revision" >&2 69 echo "warning: could not determine svn revision" >&2
75 fi 70 fi
76 71
77 # Pull in the chrome version number 72 # Pull in the chrome version number
78 . "${TOP}/chrome/VERSION" 73 . "${TOP}/chrome/VERSION"
79 FULL_VERSION="${MAJOR}.${MINOR}.${BUILD}.${PATCH}" 74 FULL_VERSION="${MAJOR}.${MINOR}.${BUILD}.${PATCH}"
80 SHORT_VERSION="${MAJOR}.${MINOR}.${BUILD}" 75 SHORT_VERSION="${MAJOR}.${MINOR}.${BUILD}"
81 76
82 # Load the branding file 77 # Fetch the copyright
83 if [ "${BUILD_BRANDING}" == "Chromium" ]; then 78 COPYRIGHT_STRING=$("${BRAND_SCRIPT}" "${BUILD_BRANDING}" COPYRIGHT)
84 BRANDING_FILE="${TOP}/chrome/app/theme/chromium/BRANDING"
85 elif [ "${BUILD_BRANDING}" == "Chrome" ]; then
86 BRANDING_FILE="${TOP}/chrome/app/theme/google_chrome/BRANDING"
87 else
88 echo "error: unknown branding: ${BUILD_BRANDING}" >&2
89 exit 1
90 fi
91 COPYRIGHT_STRING=$(sed -n -e 's/^COPYRIGHT=\(.*\)$/\1/p' "${BRANDING_FILE}")
92 # Map (c) or (C) to the copyright sign 79 # Map (c) or (C) to the copyright sign
93 COPYRIGHT_STRING=$(echo "${COPYRIGHT_STRING}" | sed -e $'s/([cC])/\302\251/g') 80 COPYRIGHT_STRING=$(echo "${COPYRIGHT_STRING}" | sed -e $'s/([cC])/\302\251/g')
94 81
95 # Build the full copyright string 82 # Build the full copyright string
96 LONG_COPYRIGHT="${APP_NAME} ${FULL_VERSION}, ${COPYRIGHT_STRING}" 83 LONG_COPYRIGHT="${APP_NAME} ${FULL_VERSION}, ${COPYRIGHT_STRING}"
97 84
98 # I really hate how "defaults" doesn't take a real pathname but instead insists 85 # I really hate how "defaults" doesn't take a real pathname but instead insists
99 # on appending ".plist" to everything. 86 # on appending ".plist" to everything.
100 INFO_PLIST_PATH="Contents/Info.plist" 87 INFO_PLIST_PATH="Contents/Info.plist"
101 TMP_INFO_PLIST_DEFAULTS="${TEMP_DIR}/Info" 88 TMP_INFO_PLIST_DEFAULTS="${TEMP_DIR}/Info"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" BreakpadVersion || true 132 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" BreakpadVersion || true
146 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" BreakpadSendAndExit || true 133 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" BreakpadSendAndExit || true
147 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" BreakpadSkipConfirm || true 134 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" BreakpadSkipConfirm || true
148 fi 135 fi
149 136
150 # Info.plist will work perfectly well in any plist format, but traditionally 137 # Info.plist will work perfectly well in any plist format, but traditionally
151 # applications use xml1 for this, so convert it back after whatever defaults 138 # applications use xml1 for this, so convert it back after whatever defaults
152 # might have done. 139 # might have done.
153 plutil -convert xml1 "${TMP_INFO_PLIST}" 140 plutil -convert xml1 "${TMP_INFO_PLIST}"
154 cp "${TMP_INFO_PLIST}" "${SRC_APP_PATH}/${INFO_PLIST_PATH}" 141 cp "${TMP_INFO_PLIST}" "${SRC_APP_PATH}/${INFO_PLIST_PATH}"
OLDNEW
« build/mac/build_app_dmg ('K') | « build/mac/dump_app_syms ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698