| 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   dex_cmd = [dx_binary, '--dex', '--force-jumbo', '--output', options.dex_path] | 18   # --num-threads=10 made final dexing go from 10s -> 5s on a z620. | 
|  | 19   dex_cmd = [dx_binary, '--num-threads=10', '--dex', '--force-jumbo', | 
|  | 20              '--output', options.dex_path] | 
| 19   if options.no_locals != '0': | 21   if options.no_locals != '0': | 
| 20     dex_cmd.append('--no-locals') | 22     dex_cmd.append('--no-locals') | 
| 21 | 23 | 
| 22   dex_cmd += paths | 24   dex_cmd += paths | 
| 23 | 25 | 
| 24   record_path = '%s.md5.stamp' % options.dex_path | 26   record_path = '%s.md5.stamp' % options.dex_path | 
| 25   md5_check.CallAndRecordIfStale( | 27   md5_check.CallAndRecordIfStale( | 
| 26       lambda: build_utils.CheckOutput(dex_cmd, print_stderr=False), | 28       lambda: build_utils.CheckOutput(dex_cmd, print_stderr=False), | 
| 27       record_path=record_path, | 29       record_path=record_path, | 
| 28       input_paths=paths, | 30       input_paths=paths, | 
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 73 | 75 | 
| 74   if options.depfile: | 76   if options.depfile: | 
| 75     build_utils.WriteDepfile( | 77     build_utils.WriteDepfile( | 
| 76         options.depfile, | 78         options.depfile, | 
| 77         paths + build_utils.GetPythonDependencies()) | 79         paths + build_utils.GetPythonDependencies()) | 
| 78 | 80 | 
| 79 | 81 | 
| 80 | 82 | 
| 81 if __name__ == '__main__': | 83 if __name__ == '__main__': | 
| 82   sys.exit(main()) | 84   sys.exit(main()) | 
| OLD | NEW | 
|---|