OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Entry point for both build and try bots | 6 """Entry point for both build and try bots |
7 | 7 |
8 This script is invoked from XXX, usually without arguments | 8 This script is invoked from XXX, usually without arguments |
9 to package an SDK. It automatically determines whether | 9 to package an SDK. It automatically determines whether |
10 this SDK is for mac, win, linux. | 10 this SDK is for mac, win, linux. |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 action='store_true', dest='skip_tar', default=False) | 473 action='store_true', dest='skip_tar', default=False) |
474 parser.add_option('--archive', help='Force the archive step.', | 474 parser.add_option('--archive', help='Force the archive step.', |
475 action='store_true', dest='archive', default=False) | 475 action='store_true', dest='archive', default=False) |
476 parser.add_option('--release', help='PPAPI release version.', | 476 parser.add_option('--release', help='PPAPI release version.', |
477 dest='release', default=None) | 477 dest='release', default=None) |
478 | 478 |
479 options, args = parser.parse_args(args[1:]) | 479 options, args = parser.parse_args(args[1:]) |
480 platform = getos.GetPlatform() | 480 platform = getos.GetPlatform() |
481 arch = 'x86' | 481 arch = 'x86' |
482 | 482 |
483 toolchains = ['newlib', 'glibc'] | 483 if not options.pnacl: |
484 if options.pnacl: | 484 toolchains = ['newlib', 'glibc'] |
485 toolchains.append('pnacl') | 485 else: |
486 | 486 toolchains = ['pnacl'] |
| 487 print 'Building: ' + ' '.join(toolchains) |
487 skip = options.examples or options.update | 488 skip = options.examples or options.update |
488 | 489 |
489 skip_examples = skip | 490 skip_examples = skip |
490 skip_update = skip | 491 skip_update = skip |
491 skip_untar = skip | 492 skip_untar = skip |
492 skip_build = skip | 493 skip_build = skip |
493 skip_tar = skip or options.skip_tar | 494 skip_tar = skip or options.skip_tar |
494 | 495 |
495 if options.examples: skip_examples = False | 496 if options.examples: skip_examples = False |
496 if options.update: skip_update = False | 497 if options.update: skip_update = False |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 BuildStep('Add MAKE') | 534 BuildStep('Add MAKE') |
534 http_download.HttpDownload(GSTORE + MAKE, | 535 http_download.HttpDownload(GSTORE + MAKE, |
535 os.path.join(pepperdir, 'tools' ,'make.exe')) | 536 os.path.join(pepperdir, 'tools' ,'make.exe')) |
536 | 537 |
537 if not skip_examples: | 538 if not skip_examples: |
538 CopyExamples(pepperdir, toolchains) | 539 CopyExamples(pepperdir, toolchains) |
539 | 540 |
540 if not skip_tar: | 541 if not skip_tar: |
541 BuildStep('Tar Pepper Bundle') | 542 BuildStep('Tar Pepper Bundle') |
542 tarname = 'naclsdk_' + platform + '.bz2' | 543 tarname = 'naclsdk_' + platform + '.bz2' |
| 544 if 'pnacl' in toolchains: |
| 545 tarname = 'p' + tarname |
543 tarfile = os.path.join(OUT_DIR, tarname) | 546 tarfile = os.path.join(OUT_DIR, tarname) |
544 Run([sys.executable, CYGTAR, '-C', OUT_DIR, '-cjf', tarfile, | 547 Run([sys.executable, CYGTAR, '-C', OUT_DIR, '-cjf', tarfile, |
545 'pepper_' + pepper_ver], cwd=NACL_DIR) | 548 'pepper_' + pepper_ver], cwd=NACL_DIR) |
546 | 549 |
547 # Archive on non-trybots. | 550 # Archive on non-trybots. |
548 if options.archive or '-sdk' in os.environ.get('BUILDBOT_BUILDERNAME', ''): | 551 if options.archive or '-sdk' in os.environ.get('BUILDBOT_BUILDERNAME', ''): |
549 BuildStep('Archive build') | 552 BuildStep('Archive build') |
550 Archive(tarname) | 553 Archive(tarname) |
551 | 554 |
552 if not skip_examples: | 555 if not skip_examples: |
553 BuildStep('Test Build Examples') | 556 BuildStep('Test Build Examples') |
554 filelist = os.listdir(os.path.join(pepperdir, 'examples')) | 557 filelist = os.listdir(os.path.join(pepperdir, 'examples')) |
555 for filenode in filelist: | 558 for filenode in filelist: |
556 dirnode = os.path.join(pepperdir, 'examples', filenode) | 559 dirnode = os.path.join(pepperdir, 'examples', filenode) |
557 makefile = os.path.join(dirnode, 'Makefile') | 560 makefile = os.path.join(dirnode, 'Makefile') |
558 if os.path.isfile(makefile): | 561 if os.path.isfile(makefile): |
559 print "\n\nMake: " + dirnode | 562 print "\n\nMake: " + dirnode |
560 Run(['make', 'all', '-j8'], cwd=os.path.abspath(dirnode), shell=True) | 563 Run(['make', 'all', '-j8'], cwd=os.path.abspath(dirnode), shell=True) |
561 | 564 |
562 # Build SDK Tools | 565 # Build SDK Tools |
563 # if not skip_update: | 566 # if not skip_update: |
564 # BuildUpdater() | 567 # BuildUpdater() |
565 | 568 |
566 return 0 | 569 return 0 |
567 | 570 |
568 | 571 |
569 if __name__ == '__main__': | 572 if __name__ == '__main__': |
570 sys.exit(main(sys.argv)) | 573 sys.exit(main(sys.argv)) |
OLD | NEW |