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

Unified Diff: tools/upload_sdk.py

Issue 8935008: Create the SDK in dart-sdk directory. The sdk zip file's contents (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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 | « dart.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/upload_sdk.py
===================================================================
--- tools/upload_sdk.py (revision 2399)
+++ tools/upload_sdk.py (working copy)
@@ -5,8 +5,11 @@
# found in the LICENSE file.
# This zips the SDK and uploads it to Google Storage when run on a buildbot.
+#
+# Usage: upload_sdk.py path_to_sdk
import os
+import os.path
import subprocess
import sys
import utils
@@ -15,8 +18,7 @@
GSUTIL = '/b/build/scripts/slave/gsutil'
GS_SITE = 'gs://'
GS_DIR = 'dart-dump-render-tree'
-LATEST = 'latest'
-SDK = 'sdk'
+GS_SDK_DIR = 'sdk'
def ExecuteCommand(cmd):
"""Execute a command in a subprocess.
@@ -77,17 +79,19 @@
if revision is None:
sys.stderr.write('Unable to find SVN revision.\n')
return 1
- os.chdir(argv[1])
+ os.chdir(os.path.dirname(argv[1]))
+ with open(os.path.join(os.path.basename(argv[1]), 'revision'), 'w') as f:
+ f.write(revision + '\n')
+
# TODO(dgrove) - deal with architectures that are not ia32.
- sdk_name = 'dart-' + utils.GuessOS() + '-' + revision + '.zip'
- sdk_file = '../' + sdk_name
- ExecuteCommand(['zip', '-yr', sdk_file, '.'])
- UploadArchive(sdk_file, GS_SITE + os.path.join(gsdir, SDK, sdk_name))
+ sdk_file = 'dart-%s-%s.zip' % (utils.GuessOS(), revision)
+ ExecuteCommand(['zip', '-yr', sdk_file, os.path.basename(argv[1])])
+ UploadArchive(sdk_file,
+ GS_SITE + os.path.join(gsdir, GS_SDK_DIR, sdk_file))
latest_name = 'dart-' + utils.GuessOS() + '-latest' + '.zip'
- UploadArchive(sdk_file, GS_SITE + os.path.join(gsdir, SDK, latest_name))
+ UploadArchive(sdk_file,
+ GS_SITE + os.path.join(gsdir, GS_SDK_DIR, latest_name))
if __name__ == '__main__':
sys.exit(main(sys.argv))
-
-
« no previous file with comments | « dart.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698