Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Side by Side Diff: tools/create_editor.py

Issue 24596007: update build to modify 64 bit DartEditor.ini (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix mac build Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« editor/build/build.py ('K') | « editor/build/build.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 # A script which will be invoked from gyp to create a build of the editor. 7 # A script which will be invoked from gyp to create a build of the editor.
8 # 8 #
9 # Usage: ./tools/create_editor.py 9 # Usage: ./tools/create_editor.py
10 # [--mode <mode>] [--arch <arch>] [--out <output>] [--build <build>] 10 # [--mode <mode>] [--arch <arch>] [--out <output>] [--build <build>]
(...skipping 27 matching lines...) Expand all
38 } 38 }
39 39
40 def AntPath(): 40 def AntPath():
41 parent = join('third_party', 'apache_ant', '1.8.4', 'bin') 41 parent = join('third_party', 'apache_ant', '1.8.4', 'bin')
42 if utils.IsWindows(): 42 if utils.IsWindows():
43 return join(parent, 'ant.bat') 43 return join(parent, 'ant.bat')
44 else: 44 else:
45 return join(parent, 'ant') 45 return join(parent, 'ant')
46 46
47 47
48 def ProcessEditorArchive(archive, outDir): 48 def ProcessEditorArchive(arch, archive, outDir):
49 tempDir = join(GetEditorTemp(), 'editor.out') 49 tempDir = join(GetEditorTemp(), 'editor.out')
50 try: 50 try:
51 os.makedirs(tempDir) 51 os.makedirs(tempDir)
52 except OSError: 52 except OSError:
53 # Directory already exists. 53 # Directory already exists.
54 pass 54 pass
55 55
56 if utils.IsWindows(): 56 if utils.IsWindows():
57 f = zipfile.ZipFile(archive) 57 f = zipfile.ZipFile(archive)
58 f.extractall(tempDir) 58 f.extractall(tempDir)
59 f.close() 59 f.close()
60 else: 60 else:
61 subprocess.call(['unzip', '-q', archive, '-d', tempDir]) 61 subprocess.call(['unzip', '-q', archive, '-d', tempDir])
62 62
63 if arch == 'x64':
64 if utils.GuessOS() == 'macos':
65 inifile = join(tempDir, 'dart', 'DartEditor.app', 'Contents', 'MacOS', 'Da rtEditor.ini')
ricow1 2013/09/26 17:35:40 long line
danrubel 2013/09/26 18:28:45 Done.
66 else:
67 inifile = join(tempDir, 'dart', 'DartEditor.ini')
68 Modify64BitDartEditorIni(inifile)
69
63 for src in glob.glob(join(tempDir, 'dart', '*')): 70 for src in glob.glob(join(tempDir, 'dart', '*')):
64 shutil.move(src, outDir) 71 shutil.move(src, outDir)
65 72
66 shutil.rmtree(tempDir) 73 shutil.rmtree(tempDir)
67 os.unlink(archive) 74 os.unlink(archive)
68 75
69 76
77 def Modify64BitDartEditorIni(iniFilePath):
ricow1 2013/09/26 17:35:40 You could make this slightly more generic in case
danrubel 2013/09/26 18:28:45 Good idea for a future CL.
78 f = open(iniFilePath, 'r')
79 lines = f.readlines()
80 f.close()
81 lines[lines.index('-Xms40m\n')] = '-Xms256m\n'
82 lines[lines.index('-Xmx1000m\n')] = '-Xmx2000m\n'
83 f = open(iniFilePath, 'w')
84 f.writelines(lines);
85 f.close()
86
87
70 def GetEditorTemp(): 88 def GetEditorTemp():
71 return join(BUILD, 'editor.build.temp') 89 return join(BUILD, 'editor.build.temp')
72 90
73 91
74 def GetDownloadCache(): 92 def GetDownloadCache():
75 return GetEclipseBuildRoot() 93 return GetEclipseBuildRoot()
76 94
77 95
78 def GetEclipseBuildRoot(): 96 def GetEclipseBuildRoot():
79 return join(BUILD, 'editor.build.cache') 97 return join(BUILD, 'editor.build.cache')
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 if buildRcpStatus != 0: 199 if buildRcpStatus != 0:
182 sys.exit(buildRcpStatus) 200 sys.exit(buildRcpStatus)
183 201
184 # build_rcp.xml will put the built editor archive in the OUTPUT directory 202 # build_rcp.xml will put the built editor archive in the OUTPUT directory
185 # (dart-editor-macosx.cocoa.x86.zip). It contains the editor application in a 203 # (dart-editor-macosx.cocoa.x86.zip). It contains the editor application in a
186 # dart/ subdirectory. We unzip the contents of the archive into OUTPUT. It 204 # dart/ subdirectory. We unzip the contents of the archive into OUTPUT. It
187 # will use the ../dart-sdk directory as its SDK. 205 # will use the ../dart-sdk directory as its SDK.
188 archives = glob.glob(join(OUTPUT, '*.zip')) 206 archives = glob.glob(join(OUTPUT, '*.zip'))
189 207
190 if archives: 208 if archives:
191 ProcessEditorArchive(archives[0], OUTPUT) 209 ProcessEditorArchive(arch, archives[0], OUTPUT)
192 210
193 if os.path.exists(GetEditorTemp()): 211 if os.path.exists(GetEditorTemp()):
194 shutil.rmtree(GetEditorTemp()) 212 shutil.rmtree(GetEditorTemp())
195 213
196 print('\nEditor build successful') 214 print('\nEditor build successful')
197 215
198 216
199 if __name__ == '__main__': 217 if __name__ == '__main__':
200 sys.exit(Main()) 218 sys.exit(Main())
OLDNEW
« editor/build/build.py ('K') | « editor/build/build.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698