OLD | NEW |
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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 for output in self.res.GetOutputFiles(): | 215 for output in self.res.GetOutputFiles(): |
216 self.VerboseOut('Creating %s...' % output.GetFilename()) | 216 self.VerboseOut('Creating %s...' % output.GetFilename()) |
217 | 217 |
218 # Microsoft's RC compiler can only deal with single-byte or double-byte | 218 # Microsoft's RC compiler can only deal with single-byte or double-byte |
219 # files (no UTF-8), so we make all RC files UTF-16 to support all | 219 # files (no UTF-8), so we make all RC files UTF-16 to support all |
220 # character sets. | 220 # character sets. |
221 if output.GetType() in ('rc_header', 'resource_map_header', | 221 if output.GetType() in ('rc_header', 'resource_map_header', |
222 'resource_map_source', 'resource_file_map_source'): | 222 'resource_map_source', 'resource_file_map_source'): |
223 encoding = 'cp1252' | 223 encoding = 'cp1252' |
224 elif output.GetType() in ('android', 'c_format', 'js_map_format', 'plist', | 224 elif output.GetType() in ('android', 'c_format', 'js_map_format', 'plist', |
225 'plist_strings', 'doc', 'json'): | 225 'plist_strings', 'doc', 'json', |
| 226 'chrome_messages_json'): |
226 encoding = 'utf_8' | 227 encoding = 'utf_8' |
227 else: | 228 else: |
228 # TODO(gfeher) modify here to set utf-8 encoding for admx/adml | 229 # TODO(gfeher) modify here to set utf-8 encoding for admx/adml |
229 encoding = 'utf_16' | 230 encoding = 'utf_16' |
230 | 231 |
231 # Set the context, for conditional inclusion of resources | 232 # Set the context, for conditional inclusion of resources |
232 self.res.SetOutputLanguage(output.GetLanguage()) | 233 self.res.SetOutputLanguage(output.GetLanguage()) |
233 self.res.SetOutputContext(output.GetContext()) | 234 self.res.SetOutputContext(output.GetContext()) |
234 self.res.SetDefines(self.defines) | 235 self.res.SetDefines(self.defines) |
235 | 236 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 # Print out any fallback warnings, and missing translation errors, and | 285 # Print out any fallback warnings, and missing translation errors, and |
285 # exit with an error code if there are missing translations in a non-pseudo | 286 # exit with an error code if there are missing translations in a non-pseudo |
286 # and non-official build. | 287 # and non-official build. |
287 warnings = (self.res.UberClique().MissingTranslationsReport(). | 288 warnings = (self.res.UberClique().MissingTranslationsReport(). |
288 encode('ascii', 'replace')) | 289 encode('ascii', 'replace')) |
289 if warnings and self.defines.get('_google_chrome', False): | 290 if warnings and self.defines.get('_google_chrome', False): |
290 print warnings | 291 print warnings |
291 if self.res.UberClique().HasMissingTranslations(): | 292 if self.res.UberClique().HasMissingTranslations(): |
292 print self.res.UberClique().missing_translations_ | 293 print self.res.UberClique().missing_translations_ |
293 sys.exit(-1) | 294 sys.exit(-1) |
OLD | NEW |