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

Unified Diff: tools/create_sdk.py

Issue 11348295: Fix issue 7005: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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'),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698