OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2011, 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 | 7 |
8 """Tool for automating creation of a Dart bundle.""" | 8 """Tool for automating creation of a Dart bundle.""" |
9 | 9 |
10 import optparse | 10 import optparse |
(...skipping 13 matching lines...) Expand all Loading... |
24 self._top_dir = top_dir | 24 self._top_dir = top_dir |
25 self._dest = dest | 25 self._dest = dest |
26 self._verbose = verbose | 26 self._verbose = verbose |
27 self._skip_build = skip_build | 27 self._skip_build = skip_build |
28 self._os = utils.GuessOS() | 28 self._os = utils.GuessOS() |
29 self._release_build_root = utils.GetBuildRoot(self._os, mode='release', | 29 self._release_build_root = utils.GetBuildRoot(self._os, mode='release', |
30 arch='ia32') | 30 arch='ia32') |
31 self._debug_build_root = utils.GetBuildRoot(self._os, mode='debug', | 31 self._debug_build_root = utils.GetBuildRoot(self._os, mode='debug', |
32 arch='ia32') | 32 arch='ia32') |
33 self._dartc_build_root = utils.GetBuildRoot(self._os, mode='release', | 33 self._dartc_build_root = utils.GetBuildRoot(self._os, mode='release', |
34 arch='dartc') | 34 arch='ia32') |
35 | 35 |
36 @staticmethod | 36 @staticmethod |
37 def BuildOptions(): | 37 def BuildOptions(): |
38 """Make an option parser with the options supported by this tool. | 38 """Make an option parser with the options supported by this tool. |
39 | 39 |
40 Returns: | 40 Returns: |
41 A newly created OptionParser. | 41 A newly created OptionParser. |
42 """ | 42 """ |
43 op = optparse.OptionParser('usage: %prog [options]') | 43 op = optparse.OptionParser('usage: %prog [options]') |
44 op.add_option('-d', '--dest') | 44 op.add_option('-d', '--dest') |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 return path.join('native', self._os, utils.GetBuildConf(mode, 'ia32'), name) | 134 return path.join('native', self._os, utils.GetBuildConf(mode, 'ia32'), name) |
135 | 135 |
136 def _EnsureExists(self, artifact): | 136 def _EnsureExists(self, artifact): |
137 if not path.exists(artifact): | 137 if not path.exists(artifact): |
138 raise utils.Error('%s: does not exist' % artifact) | 138 raise utils.Error('%s: does not exist' % artifact) |
139 | 139 |
140 def _BuildArtifacts(self): | 140 def _BuildArtifacts(self): |
141 if not self._skip_build: | 141 if not self._skip_build: |
142 self._InvokeTool('runtime', 'build.py', '--arch=ia32', | 142 self._InvokeTool('runtime', 'build.py', '--arch=ia32', |
143 '--mode=release,debug') | 143 '--mode=release,debug') |
144 self._InvokeTool('compiler', 'build.py', '--arch=dartc', '--mode=release') | 144 self._InvokeTool('compiler', 'build.py', '--arch=ia32', '--mode=release') |
145 self._InvokeTool('language', 'build.py', '--arch=ia32', '--mode=release') | 145 self._InvokeTool('language', 'build.py', '--arch=ia32', '--mode=release') |
146 | 146 |
147 release_vm = self._GetReleaseOutput('runtime', 'dart_bin') | 147 release_vm = self._GetReleaseOutput('runtime', 'dart_bin') |
148 self._EnsureExists(release_vm) | 148 self._EnsureExists(release_vm) |
149 release_vm_dest = self._GetNativeDest('release', 'dart_bin') | 149 release_vm_dest = self._GetNativeDest('release', 'dart_bin') |
150 | 150 |
151 debug_vm = self._GetDebugOutput('runtime', 'dart_bin') | 151 debug_vm = self._GetDebugOutput('runtime', 'dart_bin') |
152 self._EnsureExists(debug_vm) | 152 self._EnsureExists(debug_vm) |
153 debug_vm_dest = self._GetNativeDest('debug', 'dart_bin') | 153 debug_vm_dest = self._GetNativeDest('debug', 'dart_bin') |
154 | 154 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 try: | 220 try: |
221 op = BundleMaker.BuildOptions() | 221 op = BundleMaker.BuildOptions() |
222 options = BundleMaker.CheckOptions(op, top_dir, cmd_line_args) | 222 options = BundleMaker.CheckOptions(op, top_dir, cmd_line_args) |
223 except utils.Error: | 223 except utils.Error: |
224 return 1 | 224 return 1 |
225 sys.exit(BundleMaker(**options).MakeBundle()) | 225 sys.exit(BundleMaker(**options).MakeBundle()) |
226 | 226 |
227 | 227 |
228 if __name__ == '__main__': | 228 if __name__ == '__main__': |
229 main() | 229 main() |
OLD | NEW |