Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Side by Side Diff: build/android/gyp/dex.py

Issue 106923002: Don't use sys.exit() in build_utils.CheckCallDie(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 dex_cmd = [dx_binary, '--dex', '--force-jumbo', '--output', options.dex_path]
19 if options.no_locals != '0': 19 if options.no_locals != '0':
20 dex_cmd.append('--no-locals') 20 dex_cmd.append('--no-locals')
21 dex_cmd += paths 21 dex_cmd += paths
22 22
23 record_path = '%s.md5.stamp' % options.dex_path 23 record_path = '%s.md5.stamp' % options.dex_path
24 md5_check.CallAndRecordIfStale( 24 md5_check.CallAndRecordIfStale(
25 lambda: build_utils.CheckCallDie(dex_cmd, suppress_output=True), 25 lambda: build_utils.CheckOutput(dex_cmd, print_stderr=False),
26 record_path=record_path, 26 record_path=record_path,
27 input_paths=paths, 27 input_paths=paths,
28 input_strings=dex_cmd) 28 input_strings=dex_cmd)
29 29
30 build_utils.Touch(options.dex_path) 30 build_utils.Touch(options.dex_path)
31 31
32 32
33 def main(argv): 33 def main(argv):
34 parser = optparse.OptionParser() 34 parser = optparse.OptionParser()
35 parser.add_option('--android-sdk-tools', 35 parser.add_option('--android-sdk-tools',
(...skipping 20 matching lines...) Expand all
56 paths = [options.proguard_enabled_input_path] 56 paths = [options.proguard_enabled_input_path]
57 57
58 DoDex(options, paths) 58 DoDex(options, paths)
59 59
60 if options.stamp: 60 if options.stamp:
61 build_utils.Touch(options.stamp) 61 build_utils.Touch(options.stamp)
62 62
63 63
64 if __name__ == '__main__': 64 if __name__ == '__main__':
65 sys.exit(main(sys.argv)) 65 sys.exit(main(sys.argv))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698