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

Side by Side Diff: tools/build.py

Issue 1663863002: Add product mode: (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 # 2 #
3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 3 # Copyright (c) 2012, 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 7
8 import optparse 8 import optparse
9 import os 9 import os
10 import re 10 import re
(...skipping 30 matching lines...) Expand all
41 the Dart repo root, 41 the Dart repo root,
42 42
43 %s , 43 %s ,
44 44
45 unless you really intend to use a non-default Makefile.""" % DART_ROOT 45 unless you really intend to use a non-default Makefile.""" % DART_ROOT
46 46
47 def BuildOptions(): 47 def BuildOptions():
48 result = optparse.OptionParser(usage=usage) 48 result = optparse.OptionParser(usage=usage)
49 result.add_option("-m", "--mode", 49 result.add_option("-m", "--mode",
50 help='Build variants (comma-separated).', 50 help='Build variants (comma-separated).',
51 metavar='[all,debug,release]', 51 metavar='[all,debug,release,product]',
52 default='debug') 52 default='debug')
53 result.add_option("-v", "--verbose", 53 result.add_option("-v", "--verbose",
54 help='Verbose output.', 54 help='Verbose output.',
55 default=False, action="store_true") 55 default=False, action="store_true")
56 result.add_option("-a", "--arch", 56 result.add_option("-a", "--arch",
57 help='Target architectures (comma-separated).', 57 help='Target architectures (comma-separated).',
58 metavar='[all,ia32,x64,simarm,arm,simarmv6,armv6,simarmv5te,armv5te,' 58 metavar='[all,ia32,x64,simarm,arm,simarmv6,armv6,simarmv5te,armv5te,'
59 'simmips,mips,simarm64,arm64,]', 59 'simmips,mips,simarm64,arm64,]',
60 default=utils.GuessArchitecture()) 60 default=utils.GuessArchitecture())
61 result.add_option("--os", 61 result.add_option("--os",
(...skipping 28 matching lines...) Expand all
90 if options.arch == 'all': 90 if options.arch == 'all':
91 options.arch = 'ia32,x64,simarm,simmips,simarm64' 91 options.arch = 'ia32,x64,simarm,simmips,simarm64'
92 if options.mode == 'all': 92 if options.mode == 'all':
93 options.mode = 'release,debug' 93 options.mode = 'release,debug'
94 if options.os == 'all': 94 if options.os == 'all':
95 options.os = 'host,android' 95 options.os = 'host,android'
96 options.mode = options.mode.split(',') 96 options.mode = options.mode.split(',')
97 options.arch = options.arch.split(',') 97 options.arch = options.arch.split(',')
98 options.os = options.os.split(',') 98 options.os = options.os.split(',')
99 for mode in options.mode: 99 for mode in options.mode:
100 if not mode in ['debug', 'release']: 100 if not mode in ['debug', 'release', 'product']:
101 print "Unknown mode %s" % mode 101 print "Unknown mode %s" % mode
102 return False 102 return False
103 for arch in options.arch: 103 for arch in options.arch:
104 archs = ['ia32', 'x64', 'simarm', 'arm', 'simarmv6', 'armv6', 104 archs = ['ia32', 'x64', 'simarm', 'arm', 'simarmv6', 'armv6',
105 'simarmv5te', 'armv5te', 'simmips', 'mips', 'simarm64', 'arm64',] 105 'simarmv5te', 'armv5te', 'simmips', 'mips', 'simarm64', 'arm64',]
106 if not arch in archs: 106 if not arch in archs:
107 print "Unknown arch %s" % arch 107 print "Unknown arch %s" % arch
108 return False 108 return False
109 options.os = [ProcessOsOption(os_name) for os_name in options.os] 109 options.os = [ProcessOsOption(os_name) for os_name in options.os]
110 for os_name in options.os: 110 for os_name in options.os:
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 else: 552 else:
553 if BuildOneConfig(options, target, target_os, 553 if BuildOneConfig(options, target, target_os,
554 mode, arch, cross_build) != 0: 554 mode, arch, cross_build) != 0:
555 return 1 555 return 1
556 556
557 return 0 557 return 0
558 558
559 559
560 if __name__ == '__main__': 560 if __name__ == '__main__':
561 sys.exit(Main()) 561 sys.exit(Main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698