| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 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 # pylint: disable=C0301 | 7 # pylint: disable=C0301 |
| 8 """Package resources into an apk. | 8 """Package resources into an apk. |
| 9 | 9 |
| 10 See https://android.googlesource.com/platform/tools/base/+/master/legacy/ant-tas
ks/src/main/java/com/android/ant/AaptExecTask.java | 10 See https://android.googlesource.com/platform/tools/base/+/master/legacy/ant-tas
ks/src/main/java/com/android/ant/AaptExecTask.java |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 if positional_args: | 123 if positional_args: |
| 124 parser.error('No positional arguments should be given.') | 124 parser.error('No positional arguments should be given.') |
| 125 | 125 |
| 126 # Check that required options have been provided. | 126 # Check that required options have been provided. |
| 127 required_options = ('android_sdk_jar', 'aapt_path', 'configuration_name', | 127 required_options = ('android_sdk_jar', 'aapt_path', 'configuration_name', |
| 128 'android_manifest', 'version_code', 'version_name', | 128 'android_manifest', 'version_code', 'version_name', |
| 129 'apk_path') | 129 'apk_path') |
| 130 | 130 |
| 131 build_utils.CheckOptions(options, parser, required=required_options) | 131 build_utils.CheckOptions(options, parser, required=required_options) |
| 132 | 132 |
| 133 options.resource_zips = build_utils.ParseGypList(options.resource_zips) | 133 options.resource_zips = build_utils.ParseGnList(options.resource_zips) |
| 134 options.language_splits = build_utils.ParseGypList(options.language_splits) | 134 options.language_splits = build_utils.ParseGnList(options.language_splits) |
| 135 return options | 135 return options |
| 136 | 136 |
| 137 | 137 |
| 138 def MoveImagesToNonMdpiFolders(res_root): | 138 def MoveImagesToNonMdpiFolders(res_root): |
| 139 """Move images from drawable-*-mdpi-* folders to drawable-* folders. | 139 """Move images from drawable-*-mdpi-* folders to drawable-* folders. |
| 140 | 140 |
| 141 Why? http://crbug.com/289843 | 141 Why? http://crbug.com/289843 |
| 142 """ | 142 """ |
| 143 for src_dir_name in os.listdir(res_root): | 143 for src_dir_name in os.listdir(res_root): |
| 144 src_components = src_dir_name.split('-') | 144 src_components = src_dir_name.split('-') |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 build_utils.CallAndWriteDepfileIfStale( | 316 build_utils.CallAndWriteDepfileIfStale( |
| 317 lambda: _OnStaleMd5(package_command, options), | 317 lambda: _OnStaleMd5(package_command, options), |
| 318 options, | 318 options, |
| 319 input_paths=input_paths, | 319 input_paths=input_paths, |
| 320 input_strings=input_strings, | 320 input_strings=input_strings, |
| 321 output_paths=output_paths) | 321 output_paths=output_paths) |
| 322 | 322 |
| 323 | 323 |
| 324 if __name__ == '__main__': | 324 if __name__ == '__main__': |
| 325 main(sys.argv[1:]) | 325 main(sys.argv[1:]) |
| OLD | NEW |