OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2015 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2015 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 """Adds the code parts to a resource APK.""" | 7 """Adds the code parts to a resource APK.""" |
8 | 8 |
9 import argparse | 9 import argparse |
10 import itertools | 10 import itertools |
11 import os | 11 import os |
12 import shutil | 12 import shutil |
13 import sys | 13 import sys |
14 import zipfile | 14 import zipfile |
15 | 15 |
16 from util import build_utils | 16 from util import build_utils |
17 | 17 |
18 | 18 |
19 # Taken from aapt's Package.cpp: | 19 # Taken from aapt's Package.cpp: |
20 _NO_COMPRESS_EXTENSIONS = ('.jpg', '.jpeg', '.png', '.gif', '.wav', '.mp2', | 20 _NO_COMPRESS_EXTENSIONS = ('.jpg', '.jpeg', '.png', '.gif', '.wav', '.mp2', |
21 '.mp3', '.ogg', '.aac', '.mpg', '.mpeg', '.mid', | 21 '.mp3', '.ogg', '.aac', '.mpg', '.mpeg', '.mid', |
22 '.midi', '.smf', '.jet', '.rtttl', '.imy', '.xmf', | 22 '.midi', '.smf', '.jet', '.rtttl', '.imy', '.xmf', |
23 '.mp4', '.m4a', '.m4v', '.3gp', '.3gpp', '.3g2', | 23 '.mp4', '.m4a', '.m4v', '.3gp', '.3gpp', '.3g2', |
24 '.3gpp2', '.amr', '.awb', '.wma', '.wmv') | 24 '.3gpp2', '.amr', '.awb', '.wma', '.wmv', '.webm') |
25 | 25 |
26 | 26 |
27 def _ParseArgs(args): | 27 def _ParseArgs(args): |
28 parser = argparse.ArgumentParser() | 28 parser = argparse.ArgumentParser() |
29 build_utils.AddDepfileOption(parser) | 29 build_utils.AddDepfileOption(parser) |
30 parser.add_argument('--assets', | 30 parser.add_argument('--assets', |
31 help='GYP-list of files to add as assets in the form ' | 31 help='GYP-list of files to add as assets in the form ' |
32 '"srcPath:zipPath", where ":zipPath" is optional.', | 32 '"srcPath:zipPath", where ":zipPath" is optional.', |
33 default='[]') | 33 default='[]') |
34 parser.add_argument('--write-asset-list', | 34 parser.add_argument('--write-asset-list', |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 build_utils.CallAndWriteDepfileIfStale( | 259 build_utils.CallAndWriteDepfileIfStale( |
260 on_stale_md5, | 260 on_stale_md5, |
261 options, | 261 options, |
262 input_paths=input_paths, | 262 input_paths=input_paths, |
263 input_strings=input_strings, | 263 input_strings=input_strings, |
264 output_paths=[options.output_apk]) | 264 output_paths=[options.output_apk]) |
265 | 265 |
266 | 266 |
267 if __name__ == '__main__': | 267 if __name__ == '__main__': |
268 main(sys.argv[1:]) | 268 main(sys.argv[1:]) |
OLD | NEW |