| Index: tools/create_sdk.py
|
| ===================================================================
|
| --- tools/create_sdk.py (revision 21257)
|
| +++ tools/create_sdk.py (working copy)
|
| @@ -55,7 +55,7 @@
|
| # ......(more will come here)
|
|
|
|
|
| -
|
| +import optparse
|
| import os
|
| import re
|
| import sys
|
| @@ -71,6 +71,16 @@
|
| # TODO(dgrove): Only import modules following Google style guide.
|
| from shutil import copyfile, copymode, copytree, ignore_patterns, rmtree, move
|
|
|
| +
|
| +def GetOptions():
|
| + options = optparse.OptionParser(usage='usage: %prog [options]')
|
| + options.add_option("--sdk_output_dir",
|
| + help='Where to output the sdk')
|
| + options.add_option("--utils_snapshot_location",
|
| + help='Location of the utils snapshot.')
|
| + return options.parse_args()
|
| +
|
| +
|
| def ReplaceInFiles(paths, subs):
|
| '''Reads a series of files, applies a series of substitutions to each, and
|
| saves them back out. subs should by a list of (pattern, replace) tuples.'''
|
| @@ -116,11 +126,12 @@
|
| # Pull in all of the gypi files which will be munged into the sdk.
|
| HOME = dirname(dirname(realpath(__file__)))
|
|
|
| - # TODO(ricow): change to use option parser, issue 9820.
|
| - SDK = argv[1]
|
| + (options, args) = GetOptions()
|
| +
|
| + SDK = options.sdk_output_dir
|
| SDK_tmp = '%s.tmp' % SDK
|
|
|
| - SNAPSHOT_LOCATION = argv[2]
|
| + SNAPSHOT_LOCATION = options.utils_snapshot_location
|
| SNAPSHOT = join(SNAPSHOT_LOCATION, 'utils_wrapper.dart.snapshot')
|
|
|
| # TODO(dgrove) - deal with architectures that are not ia32.
|
| @@ -143,7 +154,7 @@
|
| # into sdk/bin.
|
| #
|
| # TODO(dgrove) - deal with architectures that are not ia32.
|
| - build_dir = os.path.dirname(argv[1])
|
| + build_dir = os.path.dirname(SDK)
|
| dart_file_extension = ''
|
| analyzer_file_extension = ''
|
| if HOST_OS == 'win32':
|
|
|