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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 # generated by merging the resources from all libraries and the main apk | 56 # generated by merging the resources from all libraries and the main apk |
57 # project. | 57 # project. |
58 subprocess.check_call([aapt, | 58 subprocess.check_call([aapt, |
59 'package', | 59 'package', |
60 '-m', | 60 '-m', |
61 '--non-constant-id', | 61 '--non-constant-id', |
62 '--custom-package', options.R_package, | 62 '--custom-package', options.R_package, |
63 '-M', dummy_manifest, | 63 '-M', dummy_manifest, |
64 '-S', options.res_dir, | 64 '-S', options.res_dir, |
65 '-I', android_jar, | 65 '-I', android_jar, |
66 '--output-text-symbols', options.R_dir, | |
67 '-J', options.R_dir]) | 66 '-J', options.R_dir]) |
68 | 67 |
69 # Crunch image resources. This shrinks png files and is necessary for 9-patch | 68 # Crunch image resources. This shrinks png files and is necessary for 9-patch |
70 # images to display correctly. | 69 # images to display correctly. |
71 subprocess.check_call([aapt, | 70 subprocess.check_call([aapt, |
72 'crunch', | 71 'crunch', |
73 '-S', options.res_dir, | 72 '-S', options.res_dir, |
74 '-C', options.crunched_res_dir]) | 73 '-C', options.crunched_res_dir]) |
75 | 74 |
76 | 75 |
77 if __name__ == '__main__': | 76 if __name__ == '__main__': |
78 main() | 77 main() |
OLD | NEW |