| 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 18 matching lines...) Expand all Loading... |
| 29 help='Target architectures (comma-separated).', | 29 help='Target architectures (comma-separated).', |
| 30 metavar='[all,ia32,x64,simarm,arm]', | 30 metavar='[all,ia32,x64,simarm,arm]', |
| 31 default=utils.GuessArchitecture()) | 31 default=utils.GuessArchitecture()) |
| 32 result.add_option("-j", | 32 result.add_option("-j", |
| 33 help='The number of parallel jobs to run.', | 33 help='The number of parallel jobs to run.', |
| 34 metavar=HOST_CPUS, | 34 metavar=HOST_CPUS, |
| 35 default=str(HOST_CPUS)) | 35 default=str(HOST_CPUS)) |
| 36 result.add_option("--devenv", | 36 result.add_option("--devenv", |
| 37 help='Path containing devenv.com on Windows', | 37 help='Path containing devenv.com on Windows', |
| 38 default='C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\Common7\\ID
E') | 38 default='C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\Common7\\ID
E') |
| 39 result.add_option("--macsdk", |
| 40 help='MacOSX SDK version', |
| 41 metavar='[10.5,10.6,10.7]', |
| 42 default='10.5') |
| 39 return result | 43 return result |
| 40 | 44 |
| 41 | 45 |
| 42 def ProcessOptions(options): | 46 def ProcessOptions(options): |
| 43 if options.arch == 'all': | 47 if options.arch == 'all': |
| 44 options.arch = 'ia32,x64' | 48 options.arch = 'ia32,x64' |
| 45 if options.mode == 'all': | 49 if options.mode == 'all': |
| 46 options.mode = 'release,debug' | 50 options.mode = 'release,debug' |
| 47 options.mode = options.mode.split(',') | 51 options.mode = options.mode.split(',') |
| 48 options.arch = options.arch.split(',') | 52 options.arch = options.arch.split(',') |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 for mode in options.mode: | 105 for mode in options.mode: |
| 102 for arch in options.arch: | 106 for arch in options.arch: |
| 103 build_config = utils.GetBuildConf(mode, arch) | 107 build_config = utils.GetBuildConf(mode, arch) |
| 104 if HOST_OS == 'macos': | 108 if HOST_OS == 'macos': |
| 105 project_file = 'dart.xcodeproj' | 109 project_file = 'dart.xcodeproj' |
| 106 if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()): | 110 if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()): |
| 107 project_file = 'dart-%s.xcodeproj' % CurrentDirectoryBaseName() | 111 project_file = 'dart-%s.xcodeproj' % CurrentDirectoryBaseName() |
| 108 args = ['xcodebuild', | 112 args = ['xcodebuild', |
| 109 '-project', | 113 '-project', |
| 110 project_file, | 114 project_file, |
| 115 '-sdk', |
| 116 'macosx%s'%options.macsdk, |
| 111 '-target', | 117 '-target', |
| 112 target, | 118 target, |
| 113 '-parallelizeTargets', | 119 '-parallelizeTargets', |
| 114 '-configuration', | 120 '-configuration', |
| 115 build_config, | 121 build_config, |
| 116 'SYMROOT=%s' % os.path.abspath('xcodebuild') | 122 'SYMROOT=%s' % os.path.abspath('xcodebuild') |
| 117 ] | 123 ] |
| 118 elif HOST_OS == 'win32': | 124 elif HOST_OS == 'win32': |
| 119 project_file = 'dart.sln' | 125 project_file = 'dart.sln' |
| 120 if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()): | 126 if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()): |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 process.wait() | 166 process.wait() |
| 161 if process.returncode != 0: | 167 if process.returncode != 0: |
| 162 print "BUILD FAILED" | 168 print "BUILD FAILED" |
| 163 return 1 | 169 return 1 |
| 164 | 170 |
| 165 return 0 | 171 return 0 |
| 166 | 172 |
| 167 | 173 |
| 168 if __name__ == '__main__': | 174 if __name__ == '__main__': |
| 169 sys.exit(Main()) | 175 sys.exit(Main()) |
| OLD | NEW |