OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 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 import logging | 7 import logging |
8 import optparse | 8 import optparse |
9 import os | 9 import os |
10 import sys | 10 import sys |
(...skipping 30 matching lines...) Expand all Loading... |
41 for i in iz.namelist(): | 41 for i in iz.namelist(): |
42 if i.endswith('.dex'): | 42 if i.endswith('.dex'): |
43 oz.writestr(i, iz.read(i)) | 43 oz.writestr(i, iz.read(i)) |
44 os.remove(options.dex_path) | 44 os.remove(options.dex_path) |
45 os.rename(tmp_dex_path, options.dex_path) | 45 os.rename(tmp_dex_path, options.dex_path) |
46 | 46 |
47 | 47 |
48 def DoDex(options, paths, dex_args=None): | 48 def DoDex(options, paths, dex_args=None): |
49 dx_binary = os.path.join(options.android_sdk_tools, 'dx') | 49 dx_binary = os.path.join(options.android_sdk_tools, 'dx') |
50 # See http://crbug.com/272064 for context on --force-jumbo. | 50 # See http://crbug.com/272064 for context on --force-jumbo. |
51 dex_cmd = [dx_binary, '--dex', '--force-jumbo', '--output', options.dex_path] | 51 # See https://github.com/android/platform_dalvik/commit/dd140a22d for |
| 52 # --num-threads. |
| 53 dex_cmd = [dx_binary, '--num-threads=8', '--dex', '--force-jumbo', |
| 54 '--output', options.dex_path] |
52 if options.no_locals != '0': | 55 if options.no_locals != '0': |
53 dex_cmd.append('--no-locals') | 56 dex_cmd.append('--no-locals') |
54 | 57 |
55 if dex_args: | 58 if dex_args: |
56 dex_cmd += dex_args | 59 dex_cmd += dex_args |
57 | 60 |
58 dex_cmd += paths | 61 dex_cmd += paths |
59 | 62 |
60 record_path = '%s.md5.stamp' % options.dex_path | 63 record_path = '%s.md5.stamp' % options.dex_path |
61 md5_check.CallAndRecordIfStale( | 64 md5_check.CallAndRecordIfStale( |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 131 |
129 if options.depfile: | 132 if options.depfile: |
130 build_utils.WriteDepfile( | 133 build_utils.WriteDepfile( |
131 options.depfile, | 134 options.depfile, |
132 paths + build_utils.GetPythonDependencies()) | 135 paths + build_utils.GetPythonDependencies()) |
133 | 136 |
134 | 137 |
135 | 138 |
136 if __name__ == '__main__': | 139 if __name__ == '__main__': |
137 sys.exit(main()) | 140 sys.exit(main()) |
OLD | NEW |