Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 shutil | 10 import shutil |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 225 | 225 |
| 226 | 226 |
| 227 def Main(): | 227 def Main(): |
| 228 utils.ConfigureJava() | 228 utils.ConfigureJava() |
| 229 # Parse the options. | 229 # Parse the options. |
| 230 parser = BuildOptions() | 230 parser = BuildOptions() |
| 231 (options, args) = parser.parse_args() | 231 (options, args) = parser.parse_args() |
| 232 if not ProcessOptions(options, args): | 232 if not ProcessOptions(options, args): |
| 233 parser.print_help() | 233 parser.print_help() |
| 234 return 1 | 234 return 1 |
| 235 # Determine which targets to build. By default we build the "all" target. | 235 # Determine which targets to build. By default we build the "most" target. |
| 236 if len(args) == 0: | 236 if len(args) == 0: |
| 237 if HOST_OS == 'macos': | 237 target = 'most' |
|
kustermann
2013/03/27 10:21:21
If somebody types in './tools/build.py -mrelease'
Andrei Mouravski
2013/03/27 17:45:40
This was a personal request from Dan, which is why
dgrove
2013/03/28 02:30:11
Yes - this was primarily for the VM team, but also
Andrei Mouravski
2013/03/28 15:06:23
To which I ask, do most people need the editor? Or
dgrove
2013/03/28 15:17:43
probably not, but this step takes so long that it
| |
| 238 target = 'All' | |
| 239 else: | |
| 240 target = 'all' | |
| 241 else: | 238 else: |
| 242 target = args[0] | 239 target = args[0] |
| 243 | 240 |
| 244 # Remember path | 241 # Remember path |
| 245 old_path = os.environ['PATH'] | 242 old_path = os.environ['PATH'] |
| 246 # Build the targets for each requested configuration. | 243 # Build the targets for each requested configuration. |
| 247 for target_os in options.os: | 244 for target_os in options.os: |
| 248 for mode in options.mode: | 245 for mode in options.mode: |
| 249 for arch in options.arch: | 246 for arch in options.arch: |
| 250 build_config = utils.GetBuildConf(mode, arch) | 247 build_config = utils.GetBuildConf(mode, arch) |
| 251 if HOST_OS == 'macos': | 248 if HOST_OS == 'macos': |
| 252 project_file = 'dart.xcodeproj' | 249 project_file = 'dart.xcodeproj' |
| 253 if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()): | 250 if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()): |
| 254 project_file = 'dart-%s.xcodeproj' % CurrentDirectoryBaseName() | 251 project_file = 'dart-%s.xcodeproj' % CurrentDirectoryBaseName() |
| 255 args = ['xcodebuild', | 252 args = ['xcodebuild', |
| 256 '-project', | 253 '-project', |
| 257 project_file, | 254 project_file, |
| 258 '-target', | 255 '-target', |
| 259 target, | 256 target, |
| 260 '-configuration', | 257 '-configuration', |
| 261 build_config, | 258 build_config, |
| 262 'SYMROOT=%s' % os.path.abspath('xcodebuild') | 259 'SYMROOT=%s' % os.path.abspath('xcodebuild') |
| 263 ] | 260 ] |
| 264 elif HOST_OS == 'win32': | 261 elif HOST_OS == 'win32': |
| 265 project_file = 'dart.sln' | 262 project_file = 'dart.sln' |
| 266 if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()): | 263 if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()): |
| 267 project_file = 'dart-%s.sln' % CurrentDirectoryBaseName() | 264 project_file = 'dart-%s.sln' % CurrentDirectoryBaseName() |
| 268 if target == 'all': | 265 if target == 'most': |
| 269 args = [options.devenv + os.sep + options.executable, | 266 args = [options.devenv + os.sep + options.executable, |
| 270 '/build', | 267 '/build', |
| 271 build_config, | 268 build_config, |
| 272 project_file | |
| 273 ] | |
| 274 else: | |
| 275 args = [options.devenv + os.sep + options.executable, | |
| 276 '/build', | |
| 277 build_config, | |
| 278 '/project', | 269 '/project', |
| 279 target, | 270 target, |
| 280 project_file | 271 project_file |
| 281 ] | 272 ] |
| 282 else: | 273 else: |
| 283 make = 'make' | 274 make = 'make' |
| 284 if HOST_OS == 'freebsd': | 275 if HOST_OS == 'freebsd': |
| 285 make = 'gmake' | 276 make = 'gmake' |
| 286 # work around lack of flock | 277 # work around lack of flock |
| 287 os.environ['LINK'] = '$(CXX)' | 278 os.environ['LINK'] = '$(CXX)' |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 process.wait() | 311 process.wait() |
| 321 if process.returncode != 0: | 312 if process.returncode != 0: |
| 322 print "BUILD FAILED" | 313 print "BUILD FAILED" |
| 323 return 1 | 314 return 1 |
| 324 | 315 |
| 325 return 0 | 316 return 0 |
| 326 | 317 |
| 327 | 318 |
| 328 if __name__ == '__main__': | 319 if __name__ == '__main__': |
| 329 sys.exit(Main()) | 320 sys.exit(Main()) |
| OLD | NEW |