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 17 matching lines...) Expand all Loading... |
28 help='directories containing resources to be packaged') | 28 help='directories containing resources to be packaged') |
29 parser.add_option('--crunch-input-dir', | 29 parser.add_option('--crunch-input-dir', |
30 help='directory containing images to be crunched') | 30 help='directory containing images to be crunched') |
31 parser.add_option('--crunch-output-dir', | 31 parser.add_option('--crunch-output-dir', |
32 help='directory to hold crunched resources') | 32 help='directory to hold crunched resources') |
33 parser.add_option('--non-constant-id', action='store_true') | 33 parser.add_option('--non-constant-id', action='store_true') |
34 parser.add_option('--custom-package', help='Java package for R.java') | 34 parser.add_option('--custom-package', help='Java package for R.java') |
35 parser.add_option('--android-manifest', help='AndroidManifest.xml path') | 35 parser.add_option('--android-manifest', help='AndroidManifest.xml path') |
36 parser.add_option('--stamp', help='File to touch on success') | 36 parser.add_option('--stamp', help='File to touch on success') |
37 | 37 |
38 # This is part of a temporary fix for crbug.com/177552. | |
39 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | |
40 parser.add_option('--ignore', help='this argument is ignored') | |
41 (options, args) = parser.parse_args() | 38 (options, args) = parser.parse_args() |
42 | 39 |
43 if args: | 40 if args: |
44 parser.error('No positional arguments should be given.') | 41 parser.error('No positional arguments should be given.') |
45 | 42 |
46 # Check that required options have been provided. | 43 # Check that required options have been provided. |
47 required_options = ('android_sdk', 'android_sdk_tools', 'R_dir', | 44 required_options = ('android_sdk', 'android_sdk_tools', 'R_dir', |
48 'res_dirs', 'crunch_input_dir', 'crunch_output_dir') | 45 'res_dirs', 'crunch_input_dir', 'crunch_output_dir') |
49 build_utils.CheckOptions(options, parser, required=required_options) | 46 build_utils.CheckOptions(options, parser, required=required_options) |
50 | 47 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 build_utils.CheckOutput(aapt_cmd, fail_if_stderr=True) | 113 build_utils.CheckOutput(aapt_cmd, fail_if_stderr=True) |
117 | 114 |
118 MoveImagesToNonMdpiFolders(options.crunch_output_dir) | 115 MoveImagesToNonMdpiFolders(options.crunch_output_dir) |
119 | 116 |
120 if options.stamp: | 117 if options.stamp: |
121 build_utils.Touch(options.stamp) | 118 build_utils.Touch(options.stamp) |
122 | 119 |
123 | 120 |
124 if __name__ == '__main__': | 121 if __name__ == '__main__': |
125 main() | 122 main() |
OLD | NEW |