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

Side by Side Diff: tools/ninja.py

Issue 2996903002: [infra] Translate _sources.gypi files to _sources.gni files (Closed)
Patch Set: Fix script Created 3 years, 4 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 | « tools/gypi_to_gn.py ('k') | tools/process_gypis.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 # 2 #
3 # Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 3 # Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
4 # for details. All rights reserved. Use of this source code is governed by a 4 # for details. All rights reserved. Use of this source code is governed by a
5 # BSD-style license that can be found in the LICENSE file. 5 # BSD-style license that can be found in the LICENSE file.
6 6
7 import multiprocessing 7 import multiprocessing
8 import optparse 8 import optparse
9 import os 9 import os
10 import subprocess 10 import subprocess
11 import sys 11 import sys
12 import time 12 import time
13 import utils 13 import utils
14 14
15 HOST_OS = utils.GuessOS() 15 HOST_OS = utils.GuessOS()
16 HOST_CPUS = utils.GuessCpus() 16 HOST_CPUS = utils.GuessCpus()
17 SCRIPT_DIR = os.path.dirname(sys.argv[0]) 17 SCRIPT_DIR = os.path.dirname(sys.argv[0])
18 DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..')) 18 DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
19 19
20 usage = """\ 20 usage = """\
21 usage: %%prog [options] [targets] 21 usage: %%prog [options] [targets]
22 22
23 This script runs 'make' in the *current* directory. So, run it from 23 This script invokes ninja to build Dart.
24 the Dart repo root, 24 """
25
26 %s ,
27
28 unless you really intend to use a non-default Makefile.""" % DART_ROOT
29 25
30 26
31 def BuildOptions(): 27 def BuildOptions():
32 result = optparse.OptionParser(usage=usage) 28 result = optparse.OptionParser(usage=usage)
33 result.add_option("-m", "--mode", 29 result.add_option("-m", "--mode",
34 help='Build variants (comma-separated).', 30 help='Build variants (comma-separated).',
35 metavar='[all,debug,release,product]', 31 metavar='[all,debug,release,product]',
36 default='debug') 32 default='debug')
37 result.add_option("-v", "--verbose", 33 result.add_option("-v", "--verbose",
38 help='Verbose output.', 34 help='Verbose output.',
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 if r != 0: 304 if r != 0:
309 return 1 305 return 1
310 306
311 endtime = time.time() 307 endtime = time.time()
312 print ("The build took %.3f seconds" % (endtime - starttime)) 308 print ("The build took %.3f seconds" % (endtime - starttime))
313 return 0 309 return 0
314 310
315 311
316 if __name__ == '__main__': 312 if __name__ == '__main__':
317 sys.exit(Main()) 313 sys.exit(Main())
OLDNEW
« no previous file with comments | « tools/gypi_to_gn.py ('k') | tools/process_gypis.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698