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) 2013, 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 glob | 7 import glob |
| 8 import gsutil | 8 import gsutil |
| 9 import imp | 9 import imp |
| 10 import optparse | 10 import optparse |
| 11 import os | 11 import os |
| 12 import re | 12 import re |
| 13 import shutil | 13 import shutil |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 | 121 |
| 122 def DartArchiveUploadVersionFile(version_file): | 122 def DartArchiveUploadVersionFile(version_file): |
| 123 # TODO(kustermann): We don't archive trunk builds to gs://dart-archive/. | 123 # TODO(kustermann): We don't archive trunk builds to gs://dart-archive/. |
| 124 # Remove this once the channel transition is done. | 124 # Remove this once the channel transition is done. |
| 125 if CHANNEL == 'trunk': return | 125 if CHANNEL == 'trunk': return |
| 126 namer = bot_utils.GCSNamer(CHANNEL, bot_utils.ReleaseType.RAW) | 126 namer = bot_utils.GCSNamer(CHANNEL, bot_utils.ReleaseType.RAW) |
| 127 for revision in [REVISION, 'latest']: | 127 for revision in [REVISION, 'latest']: |
| 128 DartArchiveFile(version_file, namer.version_filepath(revision), | 128 DartArchiveFile(version_file, namer.version_filepath(revision), |
| 129 create_md5sum=False) | 129 create_md5sum=False) |
| 130 | 130 |
| 131 def DartArchiveUploadInstaller( | |
| 132 arch, installer_file, extension, release_type=bot_utils.ReleaseType.RAW): | |
| 133 namer = bot_utils.GCSNamer(CHANNEL, release_type) | |
| 134 for revision in [REVISION, 'latest']: | |
| 135 gsu_path = namer.editor_installer_zipfilepath( | |
| 136 revision, SYSTEM, arch, extension) | |
| 137 DartArchiveFile(installer_file, gsu_path, create_md5sum=False) | |
| 138 | |
| 131 class AntWrapper(object): | 139 class AntWrapper(object): |
| 132 """A wrapper for ant build invocations""" | 140 """A wrapper for ant build invocations""" |
| 133 | 141 |
| 134 _antpath = None | 142 _antpath = None |
| 135 _bzippath = None | 143 _bzippath = None |
| 136 _propertyfile = None | 144 _propertyfile = None |
| 137 | 145 |
| 138 def __init__(self, propertyfile, antpath='/usr/bin', bzippath=None): | 146 def __init__(self, propertyfile, antpath='/usr/bin', bzippath=None): |
| 139 """Initialize the ant path. | 147 """Initialize the ant path. |
| 140 | 148 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 254 action='store') | 262 action='store') |
| 255 result.add_option('-n', '--name', | 263 result.add_option('-n', '--name', |
| 256 help='builder name.', | 264 help='builder name.', |
| 257 action='store') | 265 action='store') |
| 258 result.add_option('-o', '--out', | 266 result.add_option('-o', '--out', |
| 259 help='Output Directory.', | 267 help='Output Directory.', |
| 260 action='store') | 268 action='store') |
| 261 result.add_option('--dest', | 269 result.add_option('--dest', |
| 262 help='Output Directory.', | 270 help='Output Directory.', |
| 263 action='store') | 271 action='store') |
| 272 result.add_option('--build-installer', | |
| 273 help='Fetch editor, build installer and archive it.', | |
| 274 action='store_true', default=False) | |
| 264 return result | 275 return result |
| 265 | 276 |
| 266 def main(): | 277 def main(): |
| 267 """Main entry point for the build program.""" | 278 """Main entry point for the build program.""" |
| 268 global BUILD_OS | 279 global BUILD_OS |
| 269 global CHANNEL | 280 global CHANNEL |
| 270 global DART_PATH | 281 global DART_PATH |
| 271 global GSU_API_DOCS_PATH | 282 global GSU_API_DOCS_PATH |
| 272 global GSU_PATH_LATEST | 283 global GSU_PATH_LATEST |
| 273 global GSU_PATH_REV | 284 global GSU_PATH_REV |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 304 | 315 |
| 305 # TODO(devoncarew): remove this hardcoded e:\ path | 316 # TODO(devoncarew): remove this hardcoded e:\ path |
| 306 buildroot_parent = {'linux': dartpath, 'macos': dartpath, 'win32': r'e:\tmp'} | 317 buildroot_parent = {'linux': dartpath, 'macos': dartpath, 'win32': r'e:\tmp'} |
| 307 buildroot = os.path.join(buildroot_parent[buildos], 'build_root') | 318 buildroot = os.path.join(buildroot_parent[buildos], 'build_root') |
| 308 | 319 |
| 309 os.chdir(buildpath) | 320 os.chdir(buildpath) |
| 310 ant_property_file = None | 321 ant_property_file = None |
| 311 sdk_zip = None | 322 sdk_zip = None |
| 312 | 323 |
| 313 try: | 324 try: |
| 314 ant_property_file = tempfile.NamedTemporaryFile(suffix='.property', | |
| 315 prefix='AntProperties', | |
| 316 delete=False) | |
| 317 ant_property_file.close() | |
| 318 ant = AntWrapper(ant_property_file.name, os.path.join(antpath, 'bin'), | |
| 319 bzip2libpath) | |
| 320 | |
| 321 ant.RunAnt(os.getcwd(), '', '', '', '', | |
| 322 '', '', buildos, ['-diagnostics']) | |
| 323 | |
| 324 parser = BuildOptions() | 325 parser = BuildOptions() |
| 325 (options, args) = parser.parse_args() | 326 (options, args) = parser.parse_args() |
| 326 # Determine which targets to build. By default we build the "all" target. | 327 # Determine which targets to build. By default we build the "all" target. |
| 327 if args: | 328 if args: |
| 328 print 'only options should be passed to this script' | 329 print 'only options should be passed to this script' |
| 329 parser.print_help() | 330 parser.print_help() |
| 330 return 2 | 331 return 2 |
| 331 | 332 |
| 332 if str(options.revision) == 'None': | 333 if str(options.revision) == 'None': |
| 333 print 'missing revision option' | 334 print 'missing revision option' |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 362 lastc = revision[-1] | 363 lastc = revision[-1] |
| 363 if lastc.isalpha(): | 364 if lastc.isalpha(): |
| 364 revision = revision[0:-1] | 365 revision = revision[0:-1] |
| 365 index = revision.find(':') | 366 index = revision.find(':') |
| 366 if index > -1: | 367 if index > -1: |
| 367 revision = revision[0:index] | 368 revision = revision[0:index] |
| 368 print 'revision = |{0}|'.format(revision) | 369 print 'revision = |{0}|'.format(revision) |
| 369 buildout = os.path.abspath(options.out) | 370 buildout = os.path.abspath(options.out) |
| 370 print 'buildout = {0}'.format(buildout) | 371 print 'buildout = {0}'.format(buildout) |
| 371 | 372 |
| 372 if not os.path.exists(buildout): | |
| 373 os.makedirs(buildout) | |
| 374 | |
| 375 # clean out old build artifacts | |
| 376 for f in os.listdir(buildout): | |
| 377 if ('dartsdk-' in f) or ('darteditor-' in f) or ('dart-editor-' in f): | |
| 378 os.remove(join(buildout, f)) | |
| 379 | |
| 380 # Get user name. If it does not start with chrome then deploy to the test | 373 # Get user name. If it does not start with chrome then deploy to the test |
| 381 # bucket; otherwise deploy to the continuous bucket. | 374 # bucket; otherwise deploy to the continuous bucket. |
| 382 username = os.environ.get('USER') | 375 username = os.environ.get('USER') |
| 383 if username is None: | 376 if username is None: |
| 384 username = os.environ.get('USERNAME') | 377 username = os.environ.get('USERNAME') |
| 385 | 378 |
| 386 if username is None: | 379 if username is None: |
| 387 print 'Could not find username' | 380 print 'Could not find username' |
| 388 return 6 | 381 return 6 |
| 389 | 382 |
| 383 build_skip_tests = os.environ.get('DART_SKIP_RUNNING_TESTS') | |
| 384 sdk_environment = os.environ | |
| 385 if sdk_environment.has_key('JAVA_HOME'): | |
| 386 print 'JAVA_HOME = {0}'.format(str(sdk_environment['JAVA_HOME'])) | |
| 387 | |
| 390 # dart-editor[-trunk], dart-editor-(win/mac/linux)[-trunk/be/dev/stable] | 388 # dart-editor[-trunk], dart-editor-(win/mac/linux)[-trunk/be/dev/stable] |
| 391 builder_name = str(options.name) | 389 builder_name = str(options.name) |
| 392 | 390 |
| 393 EDITOR_REGEXP = (r'^dart-editor(-(?P<system>(win|mac|linux)))?' + | 391 EDITOR_REGEXP = (r'^dart-editor(-(?P<installer>(installer)))?(-(?P<system>(w in|mac|linux)))?' + |
|
ricow1
2013/10/18 11:18:08
long line
kustermann
2013/10/18 14:12:13
Done.
| |
| 394 '(-(?P<channel>(trunk|be|dev|stable)))?$') | 392 '(-(?P<channel>(trunk|be|dev|stable)))?$') |
| 395 match = re.match(EDITOR_REGEXP, builder_name) | 393 match = re.match(EDITOR_REGEXP, builder_name) |
| 396 if not match: | 394 if not match: |
| 397 raise Exception("Buildername '%s' does not match pattern '%s'." | 395 raise Exception("Buildername '%s' does not match pattern '%s'." |
| 398 % (builder_name, EDITOR_REGEXP)) | 396 % (builder_name, EDITOR_REGEXP)) |
| 399 | 397 |
| 400 CHANNEL = match.groupdict()['channel'] or 'be' | 398 CHANNEL = match.groupdict()['channel'] or 'be' |
| 401 SYSTEM = match.groupdict()['system'] | 399 SYSTEM = match.groupdict()['system'] |
| 400 BUILD_INSTALLER = bool(match.groupdict()['installer']) | |
| 402 | 401 |
| 403 TRUNK_BUILD = CHANNEL == 'trunk' | 402 TRUNK_BUILD = CHANNEL == 'trunk' |
| 404 PLUGINS_BUILD = SYSTEM is None | 403 PLUGINS_BUILD = SYSTEM is None |
| 405 REVISION = revision | 404 REVISION = revision |
| 406 | 405 |
| 407 build_skip_tests = os.environ.get('DART_SKIP_RUNNING_TESTS') | 406 # Make sure the buildername and the options agree |
| 408 sdk_environment = os.environ | 407 assert BUILD_INSTALLER == options.build_installer |
| 408 | |
| 409 if username.startswith('chrome'): | 409 if username.startswith('chrome'): |
| 410 if TRUNK_BUILD: | 410 if TRUNK_BUILD: |
| 411 to_bucket = 'gs://dart-editor-archive-trunk' | 411 bucket = 'gs://dart-editor-archive-trunk' |
| 412 else: | 412 else: |
| 413 to_bucket = 'gs://dart-editor-archive-continuous' | 413 bucket = 'gs://dart-editor-archive-continuous' |
| 414 running_on_buildbot = True | 414 running_on_buildbot = True |
| 415 else: | 415 else: |
| 416 to_bucket = 'gs://dart-editor-archive-testing' | 416 bucket = 'gs://dart-editor-archive-testing' |
| 417 running_on_buildbot = False | 417 running_on_buildbot = False |
| 418 sdk_environment['DART_LOCAL_BUILD'] = 'dart-editor-archive-testing' | 418 sdk_environment['DART_LOCAL_BUILD'] = 'dart-editor-archive-testing' |
| 419 | 419 |
| 420 GSU_PATH_REV = '%s/%s' % (to_bucket, REVISION) | 420 GSU_PATH_REV = '%s/%s' % (bucket, REVISION) |
| 421 GSU_PATH_LATEST = '%s/%s' % (to_bucket, 'latest') | 421 GSU_PATH_LATEST = '%s/%s' % (bucket, 'latest') |
| 422 GSU_API_DOCS_PATH = '%s/%s' % (GSU_API_DOCS_BUCKET, REVISION) | 422 GSU_API_DOCS_PATH = '%s/%s' % (GSU_API_DOCS_BUCKET, REVISION) |
| 423 | 423 |
| 424 homegsutil = join(DART_PATH, 'third_party', 'gsutil', 'gsutil') | 424 homegsutil = join(DART_PATH, 'third_party', 'gsutil', 'gsutil') |
| 425 gsu = gsutil.GsUtil(False, homegsutil, | 425 gsu = gsutil.GsUtil(False, homegsutil, |
| 426 running_on_buildbot=running_on_buildbot) | 426 running_on_buildbot=running_on_buildbot) |
| 427 InstallDartium(buildroot, buildout, buildos, gsu) | |
| 428 if sdk_environment.has_key('JAVA_HOME'): | |
| 429 print 'JAVA_HOME = {0}'.format(str(sdk_environment['JAVA_HOME'])) | |
| 430 | 427 |
| 431 if not PLUGINS_BUILD: | 428 def build_installer(): |
| 432 StartBuildStep('create_sdk') | 429 def old_location_pair(arch, extension): |
| 433 EnsureDirectoryExists(buildout) | 430 """Returns a tuple (zip_file, installer_file) of google cloud storage |
| 434 try: | 431 locations.""" |
| 435 sdk_zip = CreateSDK(buildout) | 432 os_rename = {'win': 'win32', 'mac': 'macos', 'linux': 'linux'} |
|
ricow1
2013/10/18 11:18:08
we have a bunch of dictionaries for renames, we co
kustermann
2013/10/18 14:12:13
Well, we can remove all this special casing once w
| |
| 436 except: | 433 system = os_rename[SYSTEM] |
| 437 BuildStepFailure() | 434 return ( |
| 435 ("%s/darteditor-%s-%s.zip" % (GSU_PATH_REV, system, arch)), | |
| 436 ("%s/darteditor-installer-%s-%s.%s" | |
| 437 % (GSU_PATH_REV, system, arch, extension))) | |
| 438 if SYSTEM == 'mac': | |
| 439 for arch in ['32', '64']: | |
|
ricow1
2013/10/18 11:18:08
I would extract this into create_mac_installer()
kustermann
2013/10/18 14:12:13
Done.
| |
| 440 with utils.TempDir('build_editor_installer') as temp_dir: | |
| 441 with utils.ChangedWorkingDirectory(temp_dir): | |
| 442 (gsu_editor_zip, gsu_editor_dmg) = old_location_pair(arch, 'dmg') | |
| 443 # Fetch the editor zip file from the old location. | |
| 444 if gsu.Copy(gsu_editor_zip, 'dart.zip', False): | |
|
ricow1
2013/10/18 11:18:08
dart.zip -> editor.zip (+ you could put it into a
kustermann
2013/10/18 14:12:13
Partly done (I think the additional variable would
| |
| 445 raise Exception("gsutil command failed, aborting.") | |
| 446 | |
| 447 # Unzip the editor (which contains a directory named 'dart'). | |
| 448 bot_utils.run(['unzip', 'dart.zip']) | |
| 449 assert os.path.exists('dart') and os.path.isdir('dart') | |
| 450 | |
| 451 # Build the dmg installer | |
| 452 dmg_installer = os.path.join(temp_dir,'darteditor-installer.dmg') | |
| 453 dart_folder_icon = os.path.join(DART_PATH, | |
| 454 'editor/tools/plugins/com.google.dart.tools.ui/' + | |
| 455 'icons/dart_about_140_160.png') | |
| 456 dmg_builder = os.path.join(DART_PATH, 'tools', | |
| 457 'mac_build_editor_dmg.sh') | |
| 458 bot_utils.run([dmg_builder, dmg_installer, 'dart', | |
| 459 dart_folder_icon, "Dart Distribution"]) | |
| 460 assert os.path.exists(dmg_installer) | |
|
ricow1
2013/10/18 11:18:08
No need for this, os.path.isfile will return false
kustermann
2013/10/18 14:12:13
Done.
| |
| 461 assert os.path.isfile(dmg_installer) | |
| 462 | |
| 463 # Archive to old bucket | |
| 464 # TODO(kustermann/ricow): Remove all the old archiving code, | |
| 465 # once everything points to the new location. | |
| 466 if gsu.Copy(dmg_installer, gsu_editor_dmg): | |
| 467 raise Exception("gsutil command failed, aborting.") | |
| 468 | |
| 469 # Archive to new bucket | |
| 470 # NOTE: This is a little bit hackisch, we fetch the editor from | |
| 471 # the old bucket and archive the dmg to the new bucket here. | |
| 472 DartArchiveUploadInstaller(arch, dmg_installer, 'dmg', | |
| 473 release_type=bot_utils.ReleaseType.SIGNED) | |
| 474 else: | |
| 475 raise Exception( | |
| 476 "We currently cannot build installers for %s" % builder_name) | |
|
ricow1
2013/10/18 11:18:08
builder_name -> SYSTEM?
kustermann
2013/10/18 14:12:13
Done.
| |
| 477 def build_editor(): | |
| 478 ant_property_file = tempfile.NamedTemporaryFile(suffix='.property', | |
| 479 prefix='AntProperties', | |
| 480 delete=False) | |
| 481 ant_property_file.close() | |
| 482 ant = AntWrapper(ant_property_file.name, os.path.join(antpath, 'bin'), | |
| 483 bzip2libpath) | |
| 484 | |
| 485 ant.RunAnt(os.getcwd(), '', '', '', '', | |
| 486 '', '', buildos, ['-diagnostics']) | |
| 487 | |
| 488 if not os.path.exists(buildout): | |
| 489 os.makedirs(buildout) | |
| 490 | |
| 491 # clean out old build artifacts | |
| 492 for f in os.listdir(buildout): | |
| 493 if ('dartsdk-' in f) or ('darteditor-' in f) or ('dart-editor-' in f): | |
| 494 os.remove(join(buildout, f)) | |
| 495 | |
| 496 InstallDartium(buildroot, buildout, buildos, gsu) | |
| 497 | |
| 498 if not PLUGINS_BUILD: | |
| 499 StartBuildStep('create_sdk') | |
| 500 EnsureDirectoryExists(buildout) | |
| 501 try: | |
| 502 sdk_zip = CreateSDK(buildout) | |
| 503 except: | |
| 504 BuildStepFailure() | |
| 438 | 505 |
| 439 | 506 |
| 440 if builder_name.startswith('dart-editor-linux'): | 507 if builder_name.startswith('dart-editor-linux'): |
| 441 StartBuildStep('api_docs') | 508 StartBuildStep('api_docs') |
| 442 try: | 509 try: |
| 443 CreateApiDocs(buildout) | 510 CreateApiDocs(buildout) |
| 444 except: | 511 except: |
| 445 BuildStepFailure() | 512 BuildStepFailure() |
| 446 | 513 |
| 447 StartBuildStep(builder_name) | 514 StartBuildStep(builder_name) |
| 448 | 515 |
| 449 if PLUGINS_BUILD: | 516 if PLUGINS_BUILD: |
| 450 status = BuildUpdateSite(ant, revision, builder_name, buildroot, buildout, | 517 status = BuildUpdateSite(ant, revision, builder_name, buildroot, |
| 451 editorpath, buildos) | 518 buildout, editorpath, buildos) |
| 452 return status | |
| 453 | |
| 454 with utils.TempDir('ExtraArtifacts') as extra_artifacts: | |
| 455 #tell the ant script where to write the sdk zip file so it can | |
| 456 #be expanded later | |
| 457 status = ant.RunAnt('.', 'build_rcp.xml', revision, builder_name, | |
| 458 buildroot, buildout, editorpath, buildos, | |
| 459 sdk_zip=sdk_zip, | |
| 460 running_on_bot=running_on_buildbot, | |
| 461 extra_artifacts=extra_artifacts) | |
| 462 #the ant script writes a property file in a known location so | |
| 463 #we can read it. | |
| 464 properties = ReadPropertyFile(buildos, ant_property_file.name) | |
| 465 | |
| 466 if not properties: | |
| 467 raise Exception('no data was found in file {%s}' | |
| 468 % ant_property_file.name) | |
| 469 if status: | |
| 470 if properties['build.runtime']: | |
| 471 PrintErrorLog(properties['build.runtime']) | |
| 472 return status | 519 return status |
| 473 | 520 |
| 474 #For the dart-editor build, return at this point. | 521 with utils.TempDir('ExtraArtifacts') as extra_artifacts: |
| 475 #We don't need to install the sdk+dartium, run tests, or copy to google | 522 #tell the ant script where to write the sdk zip file so it can |
|
ricow1
2013/10/18 11:18:08
I know this is not you, but fix the comment #tell
| |
| 476 #storage. | 523 #be expanded later |
| 477 if not buildos: | 524 status = ant.RunAnt('.', 'build_rcp.xml', revision, builder_name, |
| 478 print 'skipping sdk and dartium steps for dart-editor build' | 525 buildroot, buildout, editorpath, buildos, |
| 526 sdk_zip=sdk_zip, | |
| 527 running_on_bot=running_on_buildbot, | |
| 528 extra_artifacts=extra_artifacts) | |
| 529 #the ant script writes a property file in a known location so | |
| 530 #we can read it. | |
| 531 properties = ReadPropertyFile(buildos, ant_property_file.name) | |
| 532 | |
| 533 if not properties: | |
| 534 raise Exception('no data was found in file {%s}' | |
| 535 % ant_property_file.name) | |
| 536 if status: | |
| 537 if properties['build.runtime']: | |
| 538 PrintErrorLog(properties['build.runtime']) | |
| 539 return status | |
| 540 | |
| 541 #For the dart-editor build, return at this point. | |
| 542 #We don't need to install the sdk+dartium, run tests, or copy to google | |
| 543 #storage. | |
| 544 if not buildos: | |
| 545 print 'skipping sdk and dartium steps for dart-editor build' | |
| 546 return 0 | |
| 547 | |
| 548 #This is an override for local testing | |
| 549 force_run_install = os.environ.get('FORCE_RUN_INSTALL') | |
| 550 | |
| 551 if force_run_install or (not PLUGINS_BUILD): | |
| 552 InstallSdk(buildroot, buildout, buildos, buildout) | |
| 553 InstallDartium(buildroot, buildout, buildos, gsu) | |
| 554 | |
| 555 if status: | |
| 556 return status | |
| 557 | |
| 558 if not build_skip_tests: | |
| 559 RunEditorTests(buildout, buildos) | |
| 560 | |
| 561 if buildos: | |
| 562 StartBuildStep('upload_artifacts') | |
| 563 | |
| 564 _InstallArtifacts(buildout, buildos, extra_artifacts) | |
| 565 | |
| 566 # dart-editor-linux.gtk.x86.zip --> darteditor-linux-32.zip | |
| 567 RenameRcpZipFiles(buildout) | |
| 568 | |
| 569 PostProcessEditorBuilds(buildout) | |
| 570 | |
| 571 if running_on_buildbot: | |
| 572 version_file = _FindVersionFile(buildout) | |
| 573 if version_file: | |
| 574 UploadFile(version_file, False) | |
| 575 DartArchiveUploadVersionFile(version_file) | |
| 576 | |
| 577 found_zips = _FindRcpZipFiles(buildout) | |
| 578 for zipfile in found_zips: | |
| 579 UploadFile(zipfile) | |
| 580 DartArchiveUploadEditorZipFile(zipfile) | |
| 581 | |
| 479 return 0 | 582 return 0 |
| 480 | 583 |
| 481 #This is an override for local testing | 584 if BUILD_INSTALLER: |
| 482 force_run_install = os.environ.get('FORCE_RUN_INSTALL') | 585 build_installer() |
| 483 | 586 else: |
| 484 if force_run_install or (not PLUGINS_BUILD): | 587 build_editor() |
| 485 InstallSdk(buildroot, buildout, buildos, buildout) | |
| 486 InstallDartium(buildroot, buildout, buildos, gsu) | |
| 487 | |
| 488 if status: | |
| 489 return status | |
| 490 | |
| 491 if not build_skip_tests: | |
| 492 RunEditorTests(buildout, buildos) | |
| 493 | |
| 494 if buildos: | |
| 495 StartBuildStep('upload_artifacts') | |
| 496 | |
| 497 _InstallArtifacts(buildout, buildos, extra_artifacts) | |
| 498 | |
| 499 # dart-editor-linux.gtk.x86.zip --> darteditor-linux-32.zip | |
| 500 RenameRcpZipFiles(buildout) | |
| 501 | |
| 502 PostProcessEditorBuilds(buildout) | |
| 503 | |
| 504 if running_on_buildbot: | |
| 505 version_file = _FindVersionFile(buildout) | |
| 506 if version_file: | |
| 507 UploadFile(version_file, False) | |
| 508 DartArchiveUploadVersionFile(version_file) | |
| 509 | |
| 510 found_zips = _FindRcpZipFiles(buildout) | |
| 511 for zipfile in found_zips: | |
| 512 UploadFile(zipfile) | |
| 513 DartArchiveUploadEditorZipFile(zipfile) | |
| 514 | |
| 515 return 0 | |
| 516 finally: | 588 finally: |
| 517 if ant_property_file is not None: | 589 if ant_property_file is not None: |
| 518 print 'cleaning up temp file {0}'.format(ant_property_file.name) | 590 print 'cleaning up temp file {0}'.format(ant_property_file.name) |
| 519 os.remove(ant_property_file.name) | 591 os.remove(ant_property_file.name) |
| 520 print 'cleaning up {0}'.format(buildroot) | 592 print 'cleaning up {0}'.format(buildroot) |
| 521 shutil.rmtree(buildroot, True) | 593 shutil.rmtree(buildroot, True) |
| 522 print 'Build Done' | 594 print 'Build Done' |
| 523 | 595 |
| 524 | 596 |
| 525 def ReadPropertyFile(buildos, property_file): | 597 def ReadPropertyFile(buildos, property_file): |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 691 | 763 |
| 692 # Download and unzip dartium | 764 # Download and unzip dartium |
| 693 unzip_dir = os.path.join(tmp_dir, | 765 unzip_dir = os.path.join(tmp_dir, |
| 694 os.path.splitext(os.path.basename(dartiumFile))[0]) | 766 os.path.splitext(os.path.basename(dartiumFile))[0]) |
| 695 if not os.path.exists(unzip_dir): | 767 if not os.path.exists(unzip_dir): |
| 696 os.makedirs(unzip_dir) | 768 os.makedirs(unzip_dir) |
| 697 | 769 |
| 698 # Always download as local_name.zip | 770 # Always download as local_name.zip |
| 699 tmp_zip_file = os.path.join(tmp_dir, "%s.zip" % local_name) | 771 tmp_zip_file = os.path.join(tmp_dir, "%s.zip" % local_name) |
| 700 if not os.path.exists(tmp_zip_file): | 772 if not os.path.exists(tmp_zip_file): |
| 701 gsu.Copy(dartiumFile, tmp_zip_file, False) | 773 if gsu.Copy(dartiumFile, tmp_zip_file, False): |
| 774 raise Exception("gsutil command failed, aborting.") | |
| 702 # Dartium is unzipped into unzip_dir/dartium-*/ | 775 # Dartium is unzipped into unzip_dir/dartium-*/ |
| 703 dartium_zip = ziputils.ZipUtil(tmp_zip_file, buildos) | 776 dartium_zip = ziputils.ZipUtil(tmp_zip_file, buildos) |
| 704 dartium_zip.UnZip(unzip_dir) | 777 dartium_zip.UnZip(unzip_dir) |
| 705 | 778 |
| 706 dart_zip_path = join(buildout, rcpZipFile) | 779 dart_zip_path = join(buildout, rcpZipFile) |
| 707 dart_zip = ziputils.ZipUtil(dart_zip_path, buildos) | 780 dart_zip = ziputils.ZipUtil(dart_zip_path, buildos) |
| 708 | 781 |
| 709 add_path = glob.glob(join(unzip_dir, 'dartium-*'))[0] | 782 add_path = glob.glob(join(unzip_dir, 'dartium-*'))[0] |
| 710 if system == 'windows': | 783 if system == 'windows': |
| 711 # TODO(ricow/kustermann): This is hackisch. We should make a generic | 784 # TODO(ricow/kustermann): This is hackisch. We should make a generic |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 769 #download and unzip dartium | 842 #download and unzip dartium |
| 770 unzip_dir = os.path.join(tmp_dir, | 843 unzip_dir = os.path.join(tmp_dir, |
| 771 os.path.splitext(os.path.basename(dartiumFile))[0]) | 844 os.path.splitext(os.path.basename(dartiumFile))[0]) |
| 772 if not os.path.exists(unzip_dir): | 845 if not os.path.exists(unzip_dir): |
| 773 os.makedirs(unzip_dir) | 846 os.makedirs(unzip_dir) |
| 774 # Always download as searchString.zip | 847 # Always download as searchString.zip |
| 775 basename = "%s.zip" % searchString | 848 basename = "%s.zip" % searchString |
| 776 tmp_zip_file = os.path.join(tmp_dir, basename) | 849 tmp_zip_file = os.path.join(tmp_dir, basename) |
| 777 | 850 |
| 778 if not os.path.exists(tmp_zip_file): | 851 if not os.path.exists(tmp_zip_file): |
| 779 gsu.Copy(dartiumFile, tmp_zip_file, False) | 852 if gsu.Copy(dartiumFile, tmp_zip_file, False): |
| 853 raise Exception("gsutil command failed, aborting.") | |
| 780 | 854 |
| 781 # Upload dartium zip to make sure we have consistent dartium downloads | 855 # Upload dartium zip to make sure we have consistent dartium downloads |
| 782 UploadFile(tmp_zip_file) | 856 UploadFile(tmp_zip_file) |
| 783 | 857 |
| 784 # Dartium is unzipped into ~ unzip_dir/dartium-win-full-7665.7665 | 858 # Dartium is unzipped into ~ unzip_dir/dartium-win-full-7665.7665 |
| 785 dartium_zip = ziputils.ZipUtil(tmp_zip_file, buildos) | 859 dartium_zip = ziputils.ZipUtil(tmp_zip_file, buildos) |
| 786 dartium_zip.UnZip(unzip_dir) | 860 dartium_zip.UnZip(unzip_dir) |
| 787 else: | 861 else: |
| 788 dartium_zip = ziputils.ZipUtil(tmp_zip_file, buildos) | 862 dartium_zip = ziputils.ZipUtil(tmp_zip_file, buildos) |
| 789 | 863 |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1263 """delete the given file - do not re-throw any exceptions that occur""" | 1337 """delete the given file - do not re-throw any exceptions that occur""" |
| 1264 if os.path.exists(f): | 1338 if os.path.exists(f): |
| 1265 try: | 1339 try: |
| 1266 os.remove(f) | 1340 os.remove(f) |
| 1267 except OSError: | 1341 except OSError: |
| 1268 print 'error deleting %s' % f | 1342 print 'error deleting %s' % f |
| 1269 | 1343 |
| 1270 | 1344 |
| 1271 if __name__ == '__main__': | 1345 if __name__ == '__main__': |
| 1272 sys.exit(main()) | 1346 sys.exit(main()) |
| OLD | NEW |