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

Side by Side Diff: build/android/gyp/generate_v14_compatible_resources.py

Issue 555253004: Revert of [Android] Temporarily suppress RTL start&end check error. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: patch set 1 Created 6 years, 3 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
« no previous file with comments | « no previous file | 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 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 """Convert Android xml resources to API 14 compatible. 7 """Convert Android xml resources to API 14 compatible.
8 8
9 There are two reasons that we cannot just use API 17 attributes, 9 There are two reasons that we cannot just use API 17 attributes,
10 so we are generating another set of resources by this script. 10 so we are generating another set of resources by this script.
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 rel_filename = os.path.relpath(input_filename, input_dir) 219 rel_filename = os.path.relpath(input_filename, input_dir)
220 output_v14_filename = os.path.join(output_v14_dir, rel_filename) 220 output_v14_filename = os.path.join(output_v14_dir, rel_filename)
221 GenerateV14StyleResource(input_filename, output_v14_filename) 221 GenerateV14StyleResource(input_filename, output_v14_filename)
222 222
223 223
224 def VerifyV14ResourcesInDir(input_dir, resource_type): 224 def VerifyV14ResourcesInDir(input_dir, resource_type):
225 """Verify that the resources in input_dir is compatible with v14, i.e., they 225 """Verify that the resources in input_dir is compatible with v14, i.e., they
226 don't use attributes that cause crashes on certain devices. Print an error if 226 don't use attributes that cause crashes on certain devices. Print an error if
227 they have.""" 227 they have."""
228 for input_filename in build_utils.FindInDirectory(input_dir, '*.xml'): 228 for input_filename in build_utils.FindInDirectory(input_dir, '*.xml'):
229 warning_message = ('warning : ' + input_filename + ' has an RTL attribute, ' 229 exception_message = ('error : ' + input_filename + ' has an RTL attribute, '
230 'i.e., attribute that has "start" or "end" in its name.' 230 'i.e., attribute that has "start" or "end" in its name.'
231 ' Pre-v17 resources should not include it because it ' 231 ' Pre-v17 resources should not include it because it '
232 'can cause crashes on certain devices. Please refer to ' 232 'can cause crashes on certain devices. Please refer to '
233 'http://crbug.com/243952 for the details.') 233 'http://crbug.com/243952 for the details.')
234 dom = minidom.parse(input_filename) 234 dom = minidom.parse(input_filename)
235 if resource_type in ('layout', 'xml'): 235 if resource_type in ('layout', 'xml'):
236 if GenerateV14LayoutResourceDom(dom, input_filename, False): 236 if GenerateV14LayoutResourceDom(dom, input_filename, False):
237 print warning_message 237 raise Exception(exception_message)
238 elif resource_type == 'values': 238 elif resource_type == 'values':
239 if GenerateV14StyleResourceDom(dom, input_filename, False): 239 if GenerateV14StyleResourceDom(dom, input_filename, False):
240 print warning_message 240 raise Exception(exception_message)
241 241
242 242
243 def AssertNoDeprecatedAttributesInDir(input_dir, resource_type): 243 def AssertNoDeprecatedAttributesInDir(input_dir, resource_type):
244 """Raises an exception if resources in input_dir have deprecated attributes, 244 """Raises an exception if resources in input_dir have deprecated attributes,
245 e.g., paddingLeft, paddingRight""" 245 e.g., paddingLeft, paddingRight"""
246 for input_filename in build_utils.FindInDirectory(input_dir, '*.xml'): 246 for input_filename in build_utils.FindInDirectory(input_dir, '*.xml'):
247 dom = minidom.parse(input_filename) 247 dom = minidom.parse(input_filename)
248 if resource_type in ('layout', 'xml'): 248 if resource_type in ('layout', 'xml'):
249 GenerateV14LayoutResourceDom(dom, input_filename) 249 GenerateV14LayoutResourceDom(dom, input_filename)
250 elif resource_type == 'values': 250 elif resource_type == 'values':
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 build_utils.MakeDirectory(res_v14_dir) 340 build_utils.MakeDirectory(res_v14_dir)
341 341
342 GenerateV14Resources(options.res_dir, res_v14_dir, options.verify_only) 342 GenerateV14Resources(options.res_dir, res_v14_dir, options.verify_only)
343 343
344 if options.stamp: 344 if options.stamp:
345 build_utils.Touch(options.stamp) 345 build_utils.Touch(options.stamp)
346 346
347 if __name__ == '__main__': 347 if __name__ == '__main__':
348 sys.exit(main()) 348 sys.exit(main())
349 349
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698