OLD | NEW |
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 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 for res_dir in res_dirs: | 77 for res_dir in res_dirs: |
78 package_command += ['-S', res_dir] | 78 package_command += ['-S', res_dir] |
79 if options.non_constant_id: | 79 if options.non_constant_id: |
80 package_command.append('--non-constant-id') | 80 package_command.append('--non-constant-id') |
81 if options.custom_package: | 81 if options.custom_package: |
82 package_command += ['--custom-package', options.custom_package] | 82 package_command += ['--custom-package', options.custom_package] |
83 subprocess.check_call(package_command) | 83 subprocess.check_call(package_command) |
84 | 84 |
85 # Crunch image resources. This shrinks png files and is necessary for 9-patch | 85 # Crunch image resources. This shrinks png files and is necessary for 9-patch |
86 # images to display correctly. | 86 # images to display correctly. |
| 87 build_utils.MakeDirectory(options.crunch_output_dir) |
87 subprocess.check_call([aapt, | 88 subprocess.check_call([aapt, |
88 'crunch', | 89 'crunch', |
89 '-S', options.crunch_input_dir, | 90 '-S', options.crunch_input_dir, |
90 '-C', options.crunch_output_dir]) | 91 '-C', options.crunch_output_dir]) |
91 | 92 |
92 build_utils.Touch(options.stamp) | 93 build_utils.Touch(options.stamp) |
93 | 94 |
94 | 95 |
95 if __name__ == '__main__': | 96 if __name__ == '__main__': |
96 main() | 97 main() |
OLD | NEW |