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 re | 10 import re |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 metavar=HOST_CPUS, | 69 metavar=HOST_CPUS, |
70 default=str(HOST_CPUS)) | 70 default=str(HOST_CPUS)) |
71 (vs_directory, vs_executable) = utils.GuessVisualStudioPath() | 71 (vs_directory, vs_executable) = utils.GuessVisualStudioPath() |
72 result.add_option("--devenv", | 72 result.add_option("--devenv", |
73 help='Path containing devenv.com on Windows', | 73 help='Path containing devenv.com on Windows', |
74 default=vs_directory) | 74 default=vs_directory) |
75 result.add_option("--executable", | 75 result.add_option("--executable", |
76 help='Name of the devenv.com/msbuild executable on Windows (varies for ' | 76 help='Name of the devenv.com/msbuild executable on Windows (varies for ' |
77 'different versions of Visual Studio)', | 77 'different versions of Visual Studio)', |
78 default=vs_executable) | 78 default=vs_executable) |
79 result.add_option("--use-bootstrap-for-observatory", | |
80 help='Use a stripped down Dart binary built on the host machine ' | |
81 'for building Observatory. Necessary on Linux machines which have ' | |
82 'libc incompatibilities with the prebuilt Dart binaries.', | |
83 default=False, action="store_true") | |
84 return result | 79 return result |
85 | 80 |
86 | 81 |
87 def ProcessOsOption(os_name): | 82 def ProcessOsOption(os_name): |
88 if os_name == 'host': | 83 if os_name == 'host': |
89 return HOST_OS | 84 return HOST_OS |
90 return os_name | 85 return os_name |
91 | 86 |
92 | 87 |
93 def ProcessOptions(options, args): | 88 def ProcessOptions(options, args): |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 if success: | 354 if success: |
360 icon = 'dialog-information' | 355 icon = 'dialog-information' |
361 else: | 356 else: |
362 icon = 'dialog-error' | 357 icon = 'dialog-error' |
363 command = "notify-send -i '%s' '%s' '%s' &" % (icon, message, title) | 358 command = "notify-send -i '%s' '%s' '%s' &" % (icon, message, title) |
364 elif HOST_OS == 'win32': | 359 elif HOST_OS == 'win32': |
365 if success: | 360 if success: |
366 icon = 'info' | 361 icon = 'info' |
367 else: | 362 else: |
368 icon = 'error' | 363 icon = 'error' |
369 command = ("powershell -command \"" | 364 command = ("powershell -command \"" |
370 "[reflection.assembly]::loadwithpartialname('System.Windows.Forms')" | 365 "[reflection.assembly]::loadwithpartialname('System.Windows.Forms')" |
371 "| Out-Null;" | 366 "| Out-Null;" |
372 "[reflection.assembly]::loadwithpartialname('System.Drawing')" | 367 "[reflection.assembly]::loadwithpartialname('System.Drawing')" |
373 "| Out-Null;" | 368 "| Out-Null;" |
374 "$n = new-object system.windows.forms.notifyicon;" | 369 "$n = new-object system.windows.forms.notifyicon;" |
375 "$n.icon = [system.drawing.systemicons]::information;" | 370 "$n.icon = [system.drawing.systemicons]::information;" |
376 "$n.visible = $true;" | 371 "$n.visible = $true;" |
377 "$n.showballoontip(%d, '%s', '%s', " | 372 "$n.showballoontip(%d, '%s', '%s', " |
378 "[system.windows.forms.tooltipicon]::%s);\"") % ( | 373 "[system.windows.forms.tooltipicon]::%s);\"") % ( |
379 5000, # Notification stays on for this many milliseconds | 374 5000, # Notification stays on for this many milliseconds |
380 message, title, icon) | 375 message, title, icon) |
381 | 376 |
382 if command: | 377 if command: |
383 # Ignore return code, if this command fails, it doesn't matter. | 378 # Ignore return code, if this command fails, it doesn't matter. |
384 os.system(command) | 379 os.system(command) |
385 | 380 |
386 | 381 |
387 filter_xcodebuild_output = False | 382 filter_xcodebuild_output = False |
388 def BuildOneConfig(options, target, target_os, mode, arch, override_tools): | 383 def BuildOneConfig(options, target, target_os, mode, arch, override_tools): |
389 global filter_xcodebuild_output | 384 global filter_xcodebuild_output |
390 start_time = time.time() | 385 start_time = time.time() |
391 os.environ['DART_BUILD_MODE'] = mode | 386 os.environ['DART_BUILD_MODE'] = mode |
392 if options.use_bootstrap_for_observatory != False: | |
393 os.environ['DART_USE_BOOTSTRAP_BIN'] = '1' | |
394 build_config = utils.GetBuildConf(mode, arch, target_os) | 387 build_config = utils.GetBuildConf(mode, arch, target_os) |
395 if HOST_OS == 'macos': | 388 if HOST_OS == 'macos': |
396 filter_xcodebuild_output = True | 389 filter_xcodebuild_output = True |
397 project_file = 'dart.xcodeproj' | 390 project_file = 'dart.xcodeproj' |
398 if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()): | 391 if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()): |
399 project_file = 'dart-%s.xcodeproj' % CurrentDirectoryBaseName() | 392 project_file = 'dart-%s.xcodeproj' % CurrentDirectoryBaseName() |
400 args = ['xcodebuild', | 393 args = ['xcodebuild', |
401 '-project', | 394 '-project', |
402 project_file, | 395 project_file, |
403 '-target', | 396 '-target', |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 else: | 548 else: |
556 if BuildOneConfig(options, target, target_os, | 549 if BuildOneConfig(options, target, target_os, |
557 mode, arch, cross_build) != 0: | 550 mode, arch, cross_build) != 0: |
558 return 1 | 551 return 1 |
559 | 552 |
560 return 0 | 553 return 0 |
561 | 554 |
562 | 555 |
563 if __name__ == '__main__': | 556 if __name__ == '__main__': |
564 sys.exit(Main()) | 557 sys.exit(Main()) |
OLD | NEW |