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 optparse | 7 import optparse |
8 import os | 8 import os |
9 import sys | 9 import sys |
10 | 10 |
11 from util import build_utils | 11 from util import build_utils |
12 from util import md5_check | 12 from util import md5_check |
13 | 13 |
14 | 14 |
15 def DoDex(options, paths): | 15 def DoDex(options, paths): |
16 dx_binary = os.path.join(options.android_sdk_tools, 'dx') | 16 dx_binary = os.path.join(options.android_sdk_tools, 'dx') |
17 # See http://crbug.com/272064 for context on --force-jumbo. | 17 # See http://crbug.com/272064 for context on --force-jumbo. |
18 # --num-threads=10 made final dexing go from 10s -> 5s on a z620. | 18 dex_cmd = [dx_binary, '--dex', '--force-jumbo', '--output', options.dex_path] |
19 dex_cmd = [dx_binary, '--num-threads=10', '--dex', '--force-jumbo', | |
20 '--output', options.dex_path] | |
21 if options.no_locals != '0': | 19 if options.no_locals != '0': |
22 dex_cmd.append('--no-locals') | 20 dex_cmd.append('--no-locals') |
23 | 21 |
24 dex_cmd += paths | 22 dex_cmd += paths |
25 | 23 |
26 record_path = '%s.md5.stamp' % options.dex_path | 24 record_path = '%s.md5.stamp' % options.dex_path |
27 md5_check.CallAndRecordIfStale( | 25 md5_check.CallAndRecordIfStale( |
28 lambda: build_utils.CheckOutput(dex_cmd, print_stderr=False), | 26 lambda: build_utils.CheckOutput(dex_cmd, print_stderr=False), |
29 record_path=record_path, | 27 record_path=record_path, |
30 input_paths=paths, | 28 input_paths=paths, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 73 |
76 if options.depfile: | 74 if options.depfile: |
77 build_utils.WriteDepfile( | 75 build_utils.WriteDepfile( |
78 options.depfile, | 76 options.depfile, |
79 paths + build_utils.GetPythonDependencies()) | 77 paths + build_utils.GetPythonDependencies()) |
80 | 78 |
81 | 79 |
82 | 80 |
83 if __name__ == '__main__': | 81 if __name__ == '__main__': |
84 sys.exit(main()) | 82 sys.exit(main()) |
OLD | NEW |