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

Unified Diff: tools/utils.py

Issue 1342493003: Move CheckedInSdkPath helpers to utils (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « tools/observatory_tool.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/utils.py
diff --git a/tools/utils.py b/tools/utils.py
index 2301d9bd610fdb1398bab74c981bd4a046cbd279..ae04a53801880e84b69f6253c8567df1cf593ff9 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -591,6 +591,31 @@ def DartSdkBinary():
dart_binary_prefix = os.path.join(tools_dir, '..', 'sdk' , 'bin')
return os.path.join(dart_binary_prefix, 'dart')
+
+def CheckedInSdkPath():
+ # We don't use the normal macos, linux, win32 directory names here, instead,
+ # we use the names that the download_from_google_storage script uses.
+ osdict = {'Darwin':'mac', 'Linux':'linux', 'Windows':'win'}
+ system = platform.system()
+ try:
+ osname = osdict[system]
+ except KeyError:
+ print >>sys.stderr, ('WARNING: platform "%s" not supported') % (system)
+ return None;
+ tools_dir = os.path.dirname(os.path.realpath(__file__))
+ return os.path.join(tools_dir,
+ 'sdks',
+ osname,
+ 'dart-sdk')
+
+
+def CheckedInPubPath():
+ executable_name = 'pub'
+ if platform.system() == 'Windows':
+ executable_name = 'pub.bat'
+ return os.path.join(CheckedInSdkPath(), 'bin', executable_name)
+
+
class TempDir(object):
def __init__(self, prefix=''):
self._temp_dir = None
« no previous file with comments | « tools/observatory_tool.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698