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 import optparse | 8 import optparse |
9 import os | 9 import os |
10 import shutil | 10 import shutil |
(...skipping 24 matching lines...) Expand all Loading... |
35 result.add_option("--os", | 35 result.add_option("--os", |
36 help='Target OSs (comma-separated).', | 36 help='Target OSs (comma-separated).', |
37 metavar='[all,host,android]', | 37 metavar='[all,host,android]', |
38 default='host') | 38 default='host') |
39 result.add_option("-j", | 39 result.add_option("-j", |
40 help='The number of parallel jobs to run.', | 40 help='The number of parallel jobs to run.', |
41 metavar=HOST_CPUS, | 41 metavar=HOST_CPUS, |
42 default=str(HOST_CPUS)) | 42 default=str(HOST_CPUS)) |
43 result.add_option("--devenv", | 43 result.add_option("--devenv", |
44 help='Path containing devenv.com on Windows', | 44 help='Path containing devenv.com on Windows', |
45 default='C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\Common7\\ID
E') | 45 default='C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7' |
| 46 '\\IDE') |
| 47 result.add_option("--executable", |
| 48 help='Name of the devenv.com/msbuild executable on Windows (varies for ' |
| 49 'different versions of Visual Studio)', default='devenv.com') |
46 return result | 50 return result |
47 | 51 |
48 | 52 |
49 def ProcessOsOption(os): | 53 def ProcessOsOption(os): |
50 if os == 'host': | 54 if os == 'host': |
51 return HOST_OS | 55 return HOST_OS |
52 return os | 56 return os |
53 | 57 |
54 | 58 |
55 def ProcessOptions(options, args): | 59 def ProcessOptions(options, args): |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 '-parallelizeTargets', | 259 '-parallelizeTargets', |
256 '-configuration', | 260 '-configuration', |
257 build_config, | 261 build_config, |
258 'SYMROOT=%s' % os.path.abspath('xcodebuild') | 262 'SYMROOT=%s' % os.path.abspath('xcodebuild') |
259 ] | 263 ] |
260 elif HOST_OS == 'win32': | 264 elif HOST_OS == 'win32': |
261 project_file = 'dart.sln' | 265 project_file = 'dart.sln' |
262 if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()): | 266 if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()): |
263 project_file = 'dart-%s.sln' % CurrentDirectoryBaseName() | 267 project_file = 'dart-%s.sln' % CurrentDirectoryBaseName() |
264 if target == 'all': | 268 if target == 'all': |
265 args = [options.devenv + os.sep + 'devenv.com', | 269 args = [options.devenv + os.sep + options.executable, |
266 '/build', | 270 '/build', |
267 build_config, | 271 build_config, |
268 project_file | 272 project_file |
269 ] | 273 ] |
270 else: | 274 else: |
271 args = [options.devenv + os.sep + 'devenv.com', | 275 args = [options.devenv + os.sep + options.executable, |
272 '/build', | 276 '/build', |
273 build_config, | 277 build_config, |
274 '/project', | 278 '/project', |
275 target, | 279 target, |
276 project_file | 280 project_file |
277 ] | 281 ] |
278 else: | 282 else: |
279 make = 'make' | 283 make = 'make' |
280 if HOST_OS == 'freebsd': | 284 if HOST_OS == 'freebsd': |
281 make = 'gmake' | 285 make = 'gmake' |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 process.wait() | 320 process.wait() |
317 if process.returncode != 0: | 321 if process.returncode != 0: |
318 print "BUILD FAILED" | 322 print "BUILD FAILED" |
319 return 1 | 323 return 1 |
320 | 324 |
321 return 0 | 325 return 0 |
322 | 326 |
323 | 327 |
324 if __name__ == '__main__': | 328 if __name__ == '__main__': |
325 sys.exit(Main()) | 329 sys.exit(Main()) |
OLD | NEW |