| Index: tools/create_sdk.py
|
| ===================================================================
|
| --- tools/create_sdk.py (revision 15499)
|
| +++ tools/create_sdk.py (working copy)
|
| @@ -59,6 +59,8 @@
|
| import tempfile
|
| import utils
|
|
|
| +HOST_OS = utils.GuessOS()
|
| +
|
| # TODO(dgrove): Only import modules following Google style guide.
|
| from os.path import basename, dirname, join, realpath, exists, isdir
|
|
|
| @@ -85,15 +87,14 @@
|
| # TODO(zundel): this excludes the analyzer from the sdk build until builders
|
| # have all prerequisite software installed. Also update dart.gyp.
|
| def ShouldCopyAnalyzer():
|
| - os = utils.GuessOS()
|
| - return os == 'linux' or os == 'macos'
|
| + return HOST_OS == 'linux' or HOST_OS == 'macos'
|
|
|
|
|
| def CopyShellScript(src_file, dest_dir):
|
| '''Copies a shell/batch script to the given destination directory. Handles
|
| using the appropriate platform-specific file extension.'''
|
| file_extension = ''
|
| - if utils.GuessOS() == 'win32':
|
| + if HOST_OS == 'win32':
|
| file_extension = '.bat'
|
|
|
| src = src_file + file_extension
|
| @@ -149,7 +150,7 @@
|
| build_dir = os.path.dirname(argv[1])
|
| dart_file_extension = ''
|
| analyzer_file_extension = ''
|
| - if utils.GuessOS() == 'win32':
|
| + if HOST_OS == 'win32':
|
| dart_file_extension = '.exe'
|
| analyzer_file_extension = '.bat' # TODO(zundel): test on Windows
|
| dart_import_lib_src = join(HOME, build_dir, 'dart.lib')
|
| @@ -159,8 +160,11 @@
|
| dart_dest_binary = join(BIN, 'dart' + dart_file_extension)
|
| copyfile(dart_src_binary, dart_dest_binary)
|
| copymode(dart_src_binary, dart_dest_binary)
|
| - if utils.GuessOS() != 'win32':
|
| + # Strip the binaries on platforms where that is supported.
|
| + if HOST_OS == 'linux':
|
| subprocess.call(['strip', dart_dest_binary])
|
| + elif HOST_OS == 'macos':
|
| + subprocess.call(['strip', '-x', dart_dest_binary])
|
|
|
| if ShouldCopyAnalyzer():
|
| # Copy analyzer into sdk/bin
|
| @@ -249,7 +253,7 @@
|
| ignore=ignore_patterns('.svn', 'sdk'))
|
|
|
| # Copy in 7zip for Windows.
|
| - if utils.GuessOS() == 'win32':
|
| + if HOST_OS == 'win32':
|
| copytree(join(HOME, 'third_party', '7zip'),
|
| join(join(UTIL, 'pub'), '7zip'),
|
| ignore=ignore_patterns('.svn'))
|
| @@ -263,7 +267,7 @@
|
|
|
| # Copy in cURL on all operating systems, since we need the certificates file
|
| # even outside Windows. Leave out the EXE on non-Windows systems, though.
|
| - curl_ignore_patterns = ignore_patterns('.svn') if utils.GuessOS() == 'win32' \
|
| + curl_ignore_patterns = ignore_patterns('.svn') if HOST_OS == 'win32' \
|
| else ignore_patterns('.svn', '*.exe')
|
| copytree(join(HOME, 'third_party', 'curl'),
|
| join(join(UTIL, 'pub'), 'curl'),
|
|
|