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

Unified Diff: tools/create_sdk.py

Issue 13979006: Pass in arguments to create_sdk instead of using positional command line arguments (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 months 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
« dart.gyp ('K') | « dart.gyp ('k') | 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 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':
« dart.gyp ('K') | « dart.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698