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

Unified Diff: tools/download_latest_dev_sdk.py

Issue 2992453002: Fixes dev SDK download script to sniff for the version Flutter wants (Closed)
Patch Set: Created 3 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/download_latest_dev_sdk.py
diff --git a/tools/download_latest_dev_sdk.py b/tools/download_latest_dev_sdk.py
index c5de4202594eb48a830b103663b6751900f1cf29..d39cae4ee5353109b25ad3d6cf5120aebe94462f 100755
--- a/tools/download_latest_dev_sdk.py
+++ b/tools/download_latest_dev_sdk.py
@@ -18,9 +18,11 @@ HOST_OS = utils.GuessOS()
HOST_ARCH = utils.GuessArchitecture()
SCRIPT_DIR = os.path.dirname(sys.argv[0])
DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
+FUCHSIA_ROOT = os.path.realpath(os.path.join(DART_ROOT, '..'))
+FLUTTER_ROOT = os.path.join(FUCHSIA_ROOT, 'lib', 'flutter')
-DART_VERSION = '1.25.0-dev.7.0'
-BASE_URL = 'http://gsdview.appspot.com/dart-archive/channels/dev/raw/' + DART_VERSION +'/sdk'
+DEFAULT_DART_VERSION = 'latest'
+BASE_URL = 'http://gsdview.appspot.com/dart-archive/channels/dev/raw/%s/sdk/%s'
def host_os_for_sdk(host_os):
if host_os.startswith('macos'):
@@ -45,8 +47,18 @@ def main(argv):
local_sha_path = os.path.join(sdk_path, sha_file)
remote_sha_path = os.path.join(sdk_path, sha_file + '.remote')
zip_path = os.path.join(sdk_path, zip_file)
- sha_url = BASE_URL + '/' + sha_file
- zip_url = BASE_URL + '/' + zip_file
+
+ # If we're in a Fuchsia checkout with Flutter nearby, pull the same dev SDK
+ # version that Flutter says it wants. Otherwise, pull the latest dev SDK.
+ sdk_version_path = os.path.join(
+ FLUTTER_ROOT, 'bin', 'internal', 'dart-sdk.version')
+ sdk_version = DEFAULT_DART_VERSION
+ if os.path.isfile(sdk_version_path):
+ with open(sdk_version_path, 'r') as fp:
+ sdk_version = fp.read().strip()
+
+ sha_url = (BASE_URL % (sdk_version, sha_file))
+ zip_url = (BASE_URL % (sdk_version, zip_file))
local_sha = ''
if os.path.isfile(local_sha_path):
« 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