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

Side by Side Diff: mojo/tools/mojob.py

Issue 921053003: Add option to allow mojob to specify extra gn args. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fix for qsr's review Created 5 years, 9 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
« no previous file with comments | « mojo/public/tools/BUILD.gn ('k') | mojo/tools/mopy/gn.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 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 # This a simple script to make building/testing Mojo components easier. 6 # This a simple script to make building/testing Mojo components easier.
7 7
8 import argparse 8 import argparse
9 from copy import deepcopy 9 from copy import deepcopy
10 import os 10 import os
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 if 'builder_name' in args: 58 if 'builder_name' in args:
59 additional_args['builder_name'] = args.builder_name 59 additional_args['builder_name'] = args.builder_name
60 if 'build_number' in args: 60 if 'build_number' in args:
61 additional_args['build_number'] = args.build_number 61 additional_args['build_number'] = args.build_number
62 if 'master_name' in args: 62 if 'master_name' in args:
63 additional_args['master_name'] = args.master_name 63 additional_args['master_name'] = args.master_name
64 if 'test_results_server' in args: 64 if 'test_results_server' in args:
65 additional_args['test_results_server'] = args.test_results_server 65 additional_args['test_results_server'] = args.test_results_server
66 66
67 if 'gn_args' in args:
68 additional_args['gn_args'] = args.gn_args
69
67 return Config(target_os=target_os, target_cpu=target_cpu, 70 return Config(target_os=target_os, target_cpu=target_cpu,
68 is_debug=args.debug, dcheck_always_on=args.dcheck_always_on, 71 is_debug=args.debug, dcheck_always_on=args.dcheck_always_on,
69 **additional_args) 72 **additional_args)
70 73
71 74
72 def _get_out_dir(config): 75 def _get_out_dir(config):
73 paths = Paths(config) 76 paths = Paths(config)
74 return paths.SrcRelPath(paths.build_dir) 77 return paths.SrcRelPath(paths.build_dir)
75 78
76 79
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 203
201 subparsers = parser.add_subparsers() 204 subparsers = parser.add_subparsers()
202 205
203 sync_parser = subparsers.add_parser('sync', parents=[parent_parser], 206 sync_parser = subparsers.add_parser('sync', parents=[parent_parser],
204 help='Sync using gclient (does not run gn).') 207 help='Sync using gclient (does not run gn).')
205 sync_parser.set_defaults(func=sync) 208 sync_parser.set_defaults(func=sync)
206 209
207 gn_parser = subparsers.add_parser('gn', parents=[parent_parser], 210 gn_parser = subparsers.add_parser('gn', parents=[parent_parser],
208 help='Run gn for mojo (does not sync).') 211 help='Run gn for mojo (does not sync).')
209 gn_parser.set_defaults(func=gn) 212 gn_parser.set_defaults(func=gn)
213 gn_parser.add_argument('--args', help='Specify extra args',
214 default=None, dest='gn_args')
210 clang_group = gn_parser.add_mutually_exclusive_group() 215 clang_group = gn_parser.add_mutually_exclusive_group()
211 clang_group.add_argument('--clang', help='Use Clang (default)', default=None, 216 clang_group.add_argument('--clang', help='Use Clang (default)', default=None,
212 action='store_true') 217 action='store_true')
213 clang_group.add_argument('--gcc', help='Use GCC', 218 clang_group.add_argument('--gcc', help='Use GCC',
214 dest='clang', action='store_false') 219 dest='clang', action='store_false')
215 goma_group = gn_parser.add_mutually_exclusive_group() 220 goma_group = gn_parser.add_mutually_exclusive_group()
216 goma_group.add_argument('--goma', 221 goma_group.add_argument('--goma',
217 help='Use Goma (if $GOMA_DIR is set or $HOME/goma ' 222 help='Use Goma (if $GOMA_DIR is set or $HOME/goma '
218 'exists; default)', 223 'exists; default)',
219 default=True, 224 default=True,
(...skipping 24 matching lines...) Expand all
244 help='Run NaCl unit tests (does not build).') 249 help='Run NaCl unit tests (does not build).')
245 nacltest_parser.set_defaults(func=nacltest) 250 nacltest_parser.set_defaults(func=nacltest)
246 251
247 args = parser.parse_args() 252 args = parser.parse_args()
248 config = _args_to_config(args) 253 config = _args_to_config(args)
249 return args.func(config) 254 return args.func(config)
250 255
251 256
252 if __name__ == '__main__': 257 if __name__ == '__main__':
253 sys.exit(main()) 258 sys.exit(main())
OLDNEW
« no previous file with comments | « mojo/public/tools/BUILD.gn ('k') | mojo/tools/mopy/gn.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698