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

Unified Diff: chrome/tools/build/repack_locales.py

Issue 10830085: Allow "cross-compiling" with GRIT (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_resources.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/tools/build/repack_locales.py
diff --git a/chrome/tools/build/repack_locales.py b/chrome/tools/build/repack_locales.py
index 3903805ee82f1a2a1e1032cbaa17c0260f878a47..007db0d78abac90218936a6239e773854f2f1767 100755
--- a/chrome/tools/build/repack_locales.py
+++ b/chrome/tools/build/repack_locales.py
@@ -26,6 +26,8 @@ GRIT_DIR = None
SHARE_INT_DIR = None
INT_DIR = None
+# The target platform. If it is not defined, sys.platform will be used.
+PLATFORM = None
tony 2012/07/31 16:47:00 I would call this OS since we call it OS in the gy
newt (away) 2012/07/31 21:13:54 Done.
class Usage(Exception):
def __init__(self, msg):
@@ -39,7 +41,7 @@ def calc_output(locale):
# reference it.
if locale == 'fake-bidi':
return '%s/%s.pak' % (INT_DIR, locale)
- if sys.platform in ('darwin',):
+ if PLATFORM == 'mac' or (PLATFORM == None and sys.platform in ('darwin',)):
# For Cocoa to find the locale at runtime, it needs to use '_' instead
# of '-' (http://crbug.com/20441). Also, 'en-US' should be represented
# simply as 'en' (http://crbug.com/19165, http://crbug.com/25578).
@@ -131,8 +133,9 @@ def DoMain(argv):
global GRIT_DIR
global SHARE_INT_DIR
global INT_DIR
+ global PLATFORM
- short_options = 'iog:s:x:b:h'
+ short_options = 'iog:s:x:b:hp:'
long_options = 'help'
print_inputs = False
@@ -140,7 +143,7 @@ def DoMain(argv):
usage_msg = ''
helpstr = """\
-Usage: %s [-h] [-i | -o] -g <DIR> -x <DIR> -s <DIR> -b <branding> <locale> [...]
+Usage: %s [-h] [-i | -o] -g <DIR> -x <DIR> -s <DIR> -b <branding> [-p <platform>] <locale> [...]
-h, --help Print this help, then exit.
-i Print the expected input file list, then exit.
-o Print the expected output file list, then exit.
@@ -148,6 +151,7 @@ Usage: %s [-h] [-i | -o] -g <DIR> -x <DIR> -s <DIR> -b <branding> <locale> [...
-x DIR Intermediate build files output directory.
-s DIR Shared intermediate build files output directory.
-b branding Branding type of this build.
+ -p platform The target platform. (e.g. mac, linux, win and etc.)
tony 2012/07/31 16:47:00 Nit: os
newt (away) 2012/07/31 21:13:54 Done.
locale [...] One or more locales to repack.""" % (
os.path.basename(__file__))
@@ -172,6 +176,8 @@ Usage: %s [-h] [-i | -o] -g <DIR> -x <DIR> -s <DIR> -b <branding> <locale> [...
INT_DIR = a
elif o in ('-b'):
BRANDING = a
+ elif o in ('-p'):
tony 2012/07/31 16:47:00 Hmm, the use of 'in' here happens to work, but it'
newt (away) 2012/07/31 21:13:54 I figured I might as well fix these.
+ PLATFORM = a
elif o in ('-h', '--help'):
raise Usage(helpstr)
tony 2012/07/31 16:47:00 I would probably normalize OS around here. E.g.,
newt (away) 2012/07/31 21:13:54 Done. This is much cleaner.
« no previous file with comments | « chrome/chrome_resources.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698