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

Side by Side Diff: native_client_sdk/src/build_tools/nacl-mono-builder.py

Issue 720233003: [NaCl SDK] Convert python scripts from optparse to argparse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import optparse 6 import argparse
7 import os 7 import os
8 import sys 8 import sys
9 import tarfile 9 import tarfile
10 10
11 import buildbot_common 11 import buildbot_common
12 from build_paths import SCRIPT_DIR 12 from build_paths import SCRIPT_DIR
13 13
14 SDK_BUILD_DIR = SCRIPT_DIR 14 SDK_BUILD_DIR = SCRIPT_DIR
15 MONO_BUILD_DIR = os.path.join(SDK_BUILD_DIR, 'mono_build') 15 MONO_BUILD_DIR = os.path.join(SDK_BUILD_DIR, 'mono_build')
16 MONO_DIR = os.path.join(MONO_BUILD_DIR, 'nacl-mono') 16 MONO_DIR = os.path.join(MONO_BUILD_DIR, 'nacl-mono')
17 17
18 18
19 def main(args): 19 def main(args):
20 parser = optparse.OptionParser() 20 parser = argparse.ArgumentParser()
21 parser.add_option('--arch', 21 parser.add_argument('--arch',
22 help='Target architecture', 22 help='Target architecture',
23 dest='arch', 23 dest='arch',
24 default='x86-32') 24 default='x86-32')
25 parser.add_option('--sdk-revision', 25 parser.add_argument('--sdk-revision',
26 help='SDK Revision' 26 help='SDK Revision'
27 ' (default=buildbot revision)', 27 ' (default=buildbot revision)',
28 dest='sdk_revision', 28 dest='sdk_revision',
29 default=None) 29 default=None)
30 parser.add_option('--sdk-url', 30 parser.add_argument('--sdk-url',
31 help='SDK Download URL', 31 help='SDK Download URL',
32 dest='sdk_url', 32 dest='sdk_url',
33 default=None) 33 default=None)
34 parser.add_option('--install-dir', 34 parser.add_argument('--install-dir',
35 help='Install Directory', 35 help='Install Directory',
36 dest='install_dir', 36 dest='install_dir',
37 default='naclmono') 37 default='naclmono')
38 (options, args) = parser.parse_args(args) 38 options = parser.parse_args(args)
39 39
40 assert sys.platform.find('linux') != -1 40 assert sys.platform.find('linux') != -1
41 41
42 buildbot_revision = os.environ.get('BUILDBOT_REVISION', '') 42 buildbot_revision = os.environ.get('BUILDBOT_REVISION', '')
43 43
44 build_prefix = options.arch + ' ' 44 build_prefix = options.arch + ' '
45 45
46 buildbot_common.BuildStep(build_prefix + 'Clean Old SDK') 46 buildbot_common.BuildStep(build_prefix + 'Clean Old SDK')
47 buildbot_common.MakeDir(MONO_BUILD_DIR) 47 buildbot_common.MakeDir(MONO_BUILD_DIR)
48 buildbot_common.RemoveDir(os.path.join(MONO_BUILD_DIR, 'pepper_*')) 48 buildbot_common.RemoveDir(os.path.join(MONO_BUILD_DIR, 'pepper_*'))
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 if options.arch != 'arm': 134 if options.arch != 'arm':
135 buildbot_common.BuildStep(build_prefix + 'Test Mono') 135 buildbot_common.BuildStep(build_prefix + 'Test Mono')
136 buildbot_common.Run(['make', 'check', '-j8'], 136 buildbot_common.Run(['make', 'check', '-j8'],
137 cwd=os.path.join(SDK_BUILD_DIR, arch_to_output_folder[options.arch])) 137 cwd=os.path.join(SDK_BUILD_DIR, arch_to_output_folder[options.arch]))
138 138
139 return 0 139 return 0
140 140
141 141
142 if __name__ == '__main__': 142 if __name__ == '__main__':
143 sys.exit(main(sys.argv[1:])) 143 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « native_client_sdk/src/build_tools/nacl-mono-archive.py ('k') | native_client_sdk/src/build_tools/parse_dsc.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698