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

Side by Side Diff: build/android/process_resources.py

Issue 12913028: Output better error messages during build (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 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 """Process Android library resources to generate R.java and crunched images.""" 7 """Process Android library resources to generate R.java and crunched images."""
8 8
9 import optparse 9 import optparse
10 import os 10 import os
11 import shlex 11 import shlex
12 import subprocess
13 12
14 from pylib import build_utils 13 from pylib import build_utils
15 14
16 def ParseArgs(): 15 def ParseArgs():
17 """Parses command line options. 16 """Parses command line options.
18 17
19 Returns: 18 Returns:
20 An options object as from optparse.OptionsParser.parse_args() 19 An options object as from optparse.OptionsParser.parse_args()
21 """ 20 """
22 parser = optparse.OptionParser() 21 parser = optparse.OptionParser()
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 '-I', android_jar, 72 '-I', android_jar,
74 '--output-text-symbols', options.R_dir, 73 '--output-text-symbols', options.R_dir,
75 '-J', options.R_dir] 74 '-J', options.R_dir]
76 res_dirs = shlex.split(options.res_dirs) 75 res_dirs = shlex.split(options.res_dirs)
77 for res_dir in res_dirs: 76 for res_dir in res_dirs:
78 package_command += ['-S', res_dir] 77 package_command += ['-S', res_dir]
79 if options.non_constant_id: 78 if options.non_constant_id:
80 package_command.append('--non-constant-id') 79 package_command.append('--non-constant-id')
81 if options.custom_package: 80 if options.custom_package:
82 package_command += ['--custom-package', options.custom_package] 81 package_command += ['--custom-package', options.custom_package]
83 subprocess.check_call(package_command) 82 build_utils.CheckCallDie(package_command)
84 83
85 # Crunch image resources. This shrinks png files and is necessary for 9-patch 84 # Crunch image resources. This shrinks png files and is necessary for 9-patch
86 # images to display correctly. 85 # images to display correctly.
87 build_utils.MakeDirectory(options.crunch_output_dir) 86 build_utils.MakeDirectory(options.crunch_output_dir)
88 subprocess.check_call([aapt, 87 build_utils.CheckCallDie([aapt,
89 'crunch', 88 'crunch',
Yaron 2013/03/28 23:53:10 Nit: fix indent
cjhopman 2013/03/29 00:39:50 Done.
90 '-S', options.crunch_input_dir, 89 '-S', options.crunch_input_dir,
91 '-C', options.crunch_output_dir]) 90 '-C', options.crunch_output_dir])
92 91
93 build_utils.Touch(options.stamp) 92 build_utils.Touch(options.stamp)
94 93
95 94
96 if __name__ == '__main__': 95 if __name__ == '__main__':
97 main() 96 main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698