OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2013, 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 |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 RunEditorTests(buildout, buildos) | 542 RunEditorTests(buildout, buildos) |
543 | 543 |
544 if buildos: | 544 if buildos: |
545 StartBuildStep('upload_artifacts') | 545 StartBuildStep('upload_artifacts') |
546 | 546 |
547 _InstallArtifacts(buildout, buildos, extra_artifacts) | 547 _InstallArtifacts(buildout, buildos, extra_artifacts) |
548 | 548 |
549 # dart-editor-linux.gtk.x86.zip --> darteditor-linux-32.zip | 549 # dart-editor-linux.gtk.x86.zip --> darteditor-linux-32.zip |
550 RenameRcpZipFiles(buildout) | 550 RenameRcpZipFiles(buildout) |
551 | 551 |
552 PostProcessEditorBuilds(buildout, buildos) | 552 PostProcessEditorBuilds(buildout, buildos, gsu) |
553 | 553 |
554 if running_on_buildbot: | 554 if running_on_buildbot: |
555 version_file = _FindVersionFile(buildout) | 555 version_file = _FindVersionFile(buildout) |
556 if version_file: | 556 if version_file: |
557 DartArchiveUploadVersionFile(version_file) | 557 DartArchiveUploadVersionFile(version_file) |
558 | 558 |
559 found_zips = _FindRcpZipFiles(buildout) | 559 found_zips = _FindRcpZipFiles(buildout) |
560 for zipfile in found_zips: | 560 for zipfile in found_zips: |
561 DartArchiveUploadEditorZipFile(zipfile) | 561 DartArchiveUploadEditorZipFile(zipfile) |
562 | 562 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 "dart-editor-win32.win32.x86.zip" : "darteditor-win32-32.zip", | 806 "dart-editor-win32.win32.x86.zip" : "darteditor-win32-32.zip", |
807 "dart-editor-win32.win32.x86_64.zip" : "darteditor-win32-64.zip", | 807 "dart-editor-win32.win32.x86_64.zip" : "darteditor-win32-64.zip", |
808 } | 808 } |
809 | 809 |
810 for zipFile in _FindRcpZipFiles(out_dir): | 810 for zipFile in _FindRcpZipFiles(out_dir): |
811 basename = os.path.basename(zipFile) | 811 basename = os.path.basename(zipFile) |
812 if renameMap[basename] != None: | 812 if renameMap[basename] != None: |
813 os.rename(zipFile, join(os.path.dirname(zipFile), renameMap[basename])) | 813 os.rename(zipFile, join(os.path.dirname(zipFile), renameMap[basename])) |
814 | 814 |
815 | 815 |
816 def PostProcessEditorBuilds(out_dir, buildos): | 816 def PostProcessEditorBuilds(out_dir, buildos, gsu): |
817 """Post-process the created RCP builds""" | 817 """Post-process the created RCP builds""" |
818 with utils.TempDir('editor_scratch') as scratch_dir: | 818 with utils.TempDir('editor_scratch') as scratch_dir: |
819 | 819 |
820 def instantiate_download_script_template(destination, replacements): | 820 def instantiate_download_script_template(destination, replacements): |
821 """Helper function for replacing variables in the | 821 """Helper function for replacing variables in the |
822 tools/dartium/download_shellscript_templates.{sh,bat} scripts. It will | 822 tools/dartium/download_shellscript_templates.{sh,bat} scripts. It will |
823 write the final download script to [destination] after doing all | 823 write the final download script to [destination] after doing all |
824 replacements given in the [replacements] dictionary.""" | 824 replacements given in the [replacements] dictionary.""" |
825 template_location = { | 825 template_location = { |
826 'win' : join( | 826 'win' : join( |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 dartium_download_script = join(scratch_dir, 'download_dartium_debug') | 887 dartium_download_script = join(scratch_dir, 'download_dartium_debug') |
888 instantiate_download_script_template(dartium_download_script, { | 888 instantiate_download_script_template(dartium_download_script, { |
889 'VAR_DESTINATION' : dartium_debug_name, | 889 'VAR_DESTINATION' : dartium_debug_name, |
890 'VAR_DOWNLOAD_URL' : | 890 'VAR_DOWNLOAD_URL' : |
891 ("http://dartlang.org/editor/update/channels/%s/%s/dartium/%s" | 891 ("http://dartlang.org/editor/update/channels/%s/%s/dartium/%s" |
892 % (CHANNEL, REVISION, dartium_debug_name)), | 892 % (CHANNEL, REVISION, dartium_debug_name)), |
893 }) | 893 }) |
894 f.AddFile(dartium_download_script, | 894 f.AddFile(dartium_download_script, |
895 'dart/chromium/download_dartium_debug%s' % shell_ending) | 895 'dart/chromium/download_dartium_debug%s' % shell_ending) |
896 | 896 |
| 897 def add_android_content_shell(zipFile): |
| 898 # On bleeding edge we take the latest bits, we don't want to wait |
| 899 # for the dartium builders to finish. |
| 900 revision = 'latest' if CHANNEL == 'be' else REVISION |
| 901 with utils.TempDir('apk') as tempDir: |
| 902 namer = bot_utils.GCSNamer(CHANNEL) |
| 903 content_shell_name = 'content_shell-android' |
| 904 apkName = namer.dartium_android_apk_filename(content_shell_name, |
| 905 'arm', |
| 906 'release') |
| 907 remoteApk = namer.dartium_android_apk_filepath(revision, |
| 908 content_shell_name, |
| 909 'arm', |
| 910 'release') |
| 911 local_path = os.path.join(tempDir, apkName) |
| 912 if gsu.Copy(remoteApk, local_path, False): |
| 913 raise Exception("gsutil command failed, aborting.") |
| 914 f = ziputils.ZipUtil(zipFile, buildos) |
| 915 f.AddFile(local_path, 'dart/android/%s' % apkName) |
| 916 |
897 # Create a editor.properties | 917 # Create a editor.properties |
898 editor_properties = os.path.join(scratch_dir, 'editor.properties') | 918 editor_properties = os.path.join(scratch_dir, 'editor.properties') |
899 with open(editor_properties, 'w') as fd: | 919 with open(editor_properties, 'w') as fd: |
900 fd.write("com.dart.tools.update.core.url=http://dartlang.org" | 920 fd.write("com.dart.tools.update.core.url=http://dartlang.org" |
901 "/editor/update/channels/%s/\n" % CHANNEL) | 921 "/editor/update/channels/%s/\n" % CHANNEL) |
902 | 922 |
903 for zipFile in _FindRcpZipFiles(out_dir): | 923 for zipFile in _FindRcpZipFiles(out_dir): |
904 basename = os.path.basename(zipFile) | 924 basename = os.path.basename(zipFile) |
905 is_64bit = basename.endswith('-64.zip') | 925 is_64bit = basename.endswith('-64.zip') |
906 | 926 |
(...skipping 10 matching lines...) Expand all Loading... |
917 # pointing to the correct update location of the editor for the channel | 937 # pointing to the correct update location of the editor for the channel |
918 # we're building for. | 938 # we're building for. |
919 if CHANNEL != 'be': | 939 if CHANNEL != 'be': |
920 f = ziputils.ZipUtil(zipFile, buildos) | 940 f = ziputils.ZipUtil(zipFile, buildos) |
921 f.AddFile(editor_properties, 'dart/editor.properties') | 941 f.AddFile(editor_properties, 'dart/editor.properties') |
922 | 942 |
923 # Add a shell/bat script to download contentshell and dartium debug. | 943 # Add a shell/bat script to download contentshell and dartium debug. |
924 # (including the necessary tools/dartium/download_file.dart helper). | 944 # (including the necessary tools/dartium/download_file.dart helper). |
925 add_download_scripts(zipFile, '64' if is_64bit else '32') | 945 add_download_scripts(zipFile, '64' if is_64bit else '32') |
926 | 946 |
| 947 add_android_content_shell(zipFile) |
| 948 |
927 # adjust memory params for 64 bit versions | 949 # adjust memory params for 64 bit versions |
928 if is_64bit: | 950 if is_64bit: |
929 if (basename.startswith('darteditor-macos-')): | 951 if (basename.startswith('darteditor-macos-')): |
930 inifile = join('dart', 'DartEditor.app', 'Contents', 'MacOS', | 952 inifile = join('dart', 'DartEditor.app', 'Contents', 'MacOS', |
931 'DartEditor.ini') | 953 'DartEditor.ini') |
932 else: | 954 else: |
933 inifile = join('dart', 'DartEditor.ini') | 955 inifile = join('dart', 'DartEditor.ini') |
934 | 956 |
935 if (basename.startswith('darteditor-win32-')): | 957 if (basename.startswith('darteditor-win32-')): |
936 f = zipfile.ZipFile(zipFile) | 958 f = zipfile.ZipFile(zipFile) |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 def FileDelete(f): | 1272 def FileDelete(f): |
1251 """delete the given file - do not re-throw any exceptions that occur""" | 1273 """delete the given file - do not re-throw any exceptions that occur""" |
1252 if os.path.exists(f): | 1274 if os.path.exists(f): |
1253 try: | 1275 try: |
1254 os.remove(f) | 1276 os.remove(f) |
1255 except OSError: | 1277 except OSError: |
1256 print 'error deleting %s' % f | 1278 print 'error deleting %s' % f |
1257 | 1279 |
1258 if __name__ == '__main__': | 1280 if __name__ == '__main__': |
1259 sys.exit(main()) | 1281 sys.exit(main()) |
OLD | NEW |