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

Side by Side Diff: grit/tool/build.py

Issue 9924009: Add c_format as a format option. (Closed) Base URL: https://grit-i18n.googlecode.com/svn/trunk
Patch Set: Created 8 years, 8 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
« no previous file with comments | « grit/test_suite_all.py ('k') | grit/util.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 '''The 'grit build' tool along with integration for this tool with the 6 '''The 'grit build' tool along with integration for this tool with the
7 SCons build system. 7 SCons build system.
8 ''' 8 '''
9 9
10 import filecmp 10 import filecmp
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 for output in self.res.GetOutputFiles(): 231 for output in self.res.GetOutputFiles():
232 self.VerboseOut('Creating %s...' % output.GetFilename()) 232 self.VerboseOut('Creating %s...' % output.GetFilename())
233 233
234 # Microsoft's RC compiler can only deal with single-byte or double-byte 234 # Microsoft's RC compiler can only deal with single-byte or double-byte
235 # files (no UTF-8), so we make all RC files UTF-16 to support all 235 # files (no UTF-8), so we make all RC files UTF-16 to support all
236 # character sets. 236 # character sets.
237 if output.GetType() in ('rc_header', 'resource_map_header', 237 if output.GetType() in ('rc_header', 'resource_map_header',
238 'resource_map_source', 'resource_file_map_source'): 238 'resource_map_source', 'resource_file_map_source'):
239 encoding = 'cp1252' 239 encoding = 'cp1252'
240 elif output.GetType() in ('js_map_format', 'plist', 'plist_strings', 240 elif output.GetType() in ('c_format', 'js_map_format', 'plist',
241 'doc', 'json'): 241 'plist_strings', 'doc', 'json'):
242 encoding = 'utf_8' 242 encoding = 'utf_8'
243 else: 243 else:
244 # TODO(gfeher) modify here to set utf-8 encoding for admx/adml 244 # TODO(gfeher) modify here to set utf-8 encoding for admx/adml
245 encoding = 'utf_16' 245 encoding = 'utf_16'
246 246
247 # Make the output directory if it doesn't exist. 247 # Make the output directory if it doesn't exist.
248 outdir = os.path.split(output.GetOutputFilename())[0] 248 outdir = os.path.split(output.GetOutputFilename())[0]
249 if not os.path.exists(outdir): 249 if not os.path.exists(outdir):
250 os.makedirs(outdir) 250 os.makedirs(outdir)
251 # Write the results to a temporary file and only overwrite the original 251 # Write the results to a temporary file and only overwrite the original
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 296
297 # Print out any fallback warnings, and missing translation errors, and 297 # Print out any fallback warnings, and missing translation errors, and
298 # exit with an error code if there are missing translations in a non-pseudo 298 # exit with an error code if there are missing translations in a non-pseudo
299 # and non-official build. 299 # and non-official build.
300 warnings = (self.res.UberClique().MissingTranslationsReport(). 300 warnings = (self.res.UberClique().MissingTranslationsReport().
301 encode('ascii', 'replace')) 301 encode('ascii', 'replace'))
302 if warnings and self.defines.get('_google_chrome', False): 302 if warnings and self.defines.get('_google_chrome', False):
303 print warnings 303 print warnings
304 if self.res.UberClique().HasMissingTranslations(): 304 if self.res.UberClique().HasMissingTranslations():
305 sys.exit(-1) 305 sys.exit(-1)
OLDNEW
« no previous file with comments | « grit/test_suite_all.py ('k') | grit/util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698