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 import glob | 7 import glob |
| 8 import gsutil | 8 import gsutil |
| 9 import imp | 9 import imp |
| 10 import optparse | 10 import optparse |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 861 | 861 |
| 862 | 862 |
| 863 def PostProcessEditorBuilds(out_dir): | 863 def PostProcessEditorBuilds(out_dir): |
| 864 """Post-process the created RCP builds""" | 864 """Post-process the created RCP builds""" |
| 865 | 865 |
| 866 for zipFile in _FindRcpZipFiles(out_dir): | 866 for zipFile in _FindRcpZipFiles(out_dir): |
| 867 basename = os.path.basename(zipFile) | 867 basename = os.path.basename(zipFile) |
| 868 | 868 |
| 869 print(' processing %s' % basename) | 869 print(' processing %s' % basename) |
| 870 | 870 |
| 871 # adjust memory params for 64 bit versions | |
| 872 if (basename.endswith('-64.zip')): | |
| 873 if (basename.startswith('darteditor-macos-')): | |
| 874 inifile = join('dart', 'DartEditor.app', 'Contents', 'MacOS', 'DartEdito r.ini') | |
|
ricow1
2013/09/26 17:35:40
long line
danrubel
2013/09/26 18:28:45
Done.
| |
| 875 else: | |
| 876 inifile = join('dart', 'DartEditor.ini') | |
| 877 | |
| 878 if (basename.startswith('darteditor-win32-')): | |
| 879 f = zipfile.ZipFile(zipFile) | |
| 880 f.extract(inifile) | |
| 881 f.close() | |
| 882 else: | |
|
ricow1
2013/09/26 17:35:40
why do we do it differently on windows and mac
danrubel
2013/09/26 18:28:45
I am following what's been done before in tools/cr
| |
| 883 subprocess.call(['unzip', zipFile, inifile], env=os.environ) | |
| 884 | |
| 885 Modify64BitDartEditorIni(inifile) | |
| 886 | |
| 887 if (basename.startswith('darteditor-win32-')): | |
| 888 f = zipfile.ZipFile(zipFile) | |
| 889 f.write(inifile) | |
| 890 f.close() | |
| 891 else: | |
| 892 subprocess.call(['zip', '-d', zipFile, inifile], env=os.environ) | |
| 893 subprocess.call(['zip', '-q', zipFile, inifile], env=os.environ) | |
| 894 | |
| 895 os.remove(inifile) | |
| 896 | |
| 871 # post-process the info.plist file | 897 # post-process the info.plist file |
| 872 if (basename.startswith('darteditor-macos-')): | 898 if (basename.startswith('darteditor-macos-')): |
| 873 infofile = join('dart', 'DartEditor.app', 'Contents', 'Info.plist') | 899 infofile = join('dart', 'DartEditor.app', 'Contents', 'Info.plist') |
| 874 subprocess.call(['unzip', zipFile, infofile], env=os.environ) | 900 subprocess.call(['unzip', zipFile, infofile], env=os.environ) |
| 875 ReplaceInFiles( | 901 ReplaceInFiles( |
| 876 [infofile], | 902 [infofile], |
| 877 [('<dict>', | 903 [('<dict>', |
| 878 '<dict>\n\t<key>NSHighResolutionCapable</key>\n\t\t<true/>')]) | 904 '<dict>\n\t<key>NSHighResolutionCapable</key>\n\t\t<true/>')]) |
| 879 subprocess.call(['zip', '-q', zipFile, infofile], env=os.environ) | 905 subprocess.call(['zip', '-q', zipFile, infofile], env=os.environ) |
| 880 os.remove(infofile) | 906 os.remove(infofile) |
| 881 | 907 |
| 882 | 908 |
| 909 def Modify64BitDartEditorIni(iniFilePath): | |
| 910 f = open(iniFilePath, 'r') | |
| 911 lines = f.readlines() | |
| 912 f.close() | |
| 913 lines[lines.index('-Xms40m\n')] = '-Xms256m\n' | |
| 914 lines[lines.index('-Xmx1000m\n')] = '-Xmx2000m\n' | |
| 915 f = open(iniFilePath, 'w') | |
| 916 f.writelines(lines); | |
| 917 f.close() | |
| 918 | |
| 919 | |
| 883 def RunEditorTests(buildout, buildos): | 920 def RunEditorTests(buildout, buildos): |
| 884 StartBuildStep('run_tests') | 921 StartBuildStep('run_tests') |
| 885 | 922 |
| 886 for editorArchive in _GetTestableRcpArchives(buildout): | 923 for editorArchive in _GetTestableRcpArchives(buildout): |
| 887 with utils.TempDir('editor_') as tempDir: | 924 with utils.TempDir('editor_') as tempDir: |
| 888 print 'Running tests for %s...' % editorArchive | 925 print 'Running tests for %s...' % editorArchive |
| 889 | 926 |
| 890 zipper = ziputils.ZipUtil(join(buildout, editorArchive), buildos) | 927 zipper = ziputils.ZipUtil(join(buildout, editorArchive), buildos) |
| 891 zipper.UnZip(tempDir) | 928 zipper.UnZip(tempDir) |
| 892 | 929 |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1222 """delete the given file - do not re-throw any exceptions that occur""" | 1259 """delete the given file - do not re-throw any exceptions that occur""" |
| 1223 if os.path.exists(f): | 1260 if os.path.exists(f): |
| 1224 try: | 1261 try: |
| 1225 os.remove(f) | 1262 os.remove(f) |
| 1226 except OSError: | 1263 except OSError: |
| 1227 print 'error deleting %s' % f | 1264 print 'error deleting %s' % f |
| 1228 | 1265 |
| 1229 | 1266 |
| 1230 if __name__ == '__main__': | 1267 if __name__ == '__main__': |
| 1231 sys.exit(main()) | 1268 sys.exit(main()) |
| OLD | NEW |