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

Unified Diff: tools/create_sdk.py

Issue 8819030: Create the SDK in a temporary directory and copy it as a final step. (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/create_sdk.py
===================================================================
--- tools/create_sdk.py (revision 2127)
+++ tools/create_sdk.py (working copy)
@@ -4,8 +4,12 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
#
-# A script which will be invoked from gyp to create an SDK. The SDK will be
-# used either from the command-line or from the editor. Top structure is
+# A script which will be invoked from gyp to create an SDK.
+#
+# Usage: create_sdk.py sdk_directory
+#
+# The SDK will be used either from the command-line or from the editor.
+# Top structure is
#
# ..sdk/
# ....bin/
@@ -42,10 +46,11 @@
import os
import re
import sys
+import tempfile
import utils
from os.path import dirname, join, realpath, exists, isdir
-from shutil import copyfile, copymode, copytree, ignore_patterns, rmtree
+from shutil import copyfile, copymode, copytree, ignore_patterns, rmtree, move
def Main(argv):
# Pull in all of the gpyi files which will be munged into the sdk.
@@ -75,6 +80,7 @@
HOME = dirname(dirname(realpath(__file__)))
+ SDK_tmp = tempfile.mkdtemp()
SDK = argv[1]
# TODO(dgrove) - deal with architectures that are not ia32.
@@ -90,7 +96,7 @@
rmtree(SDK)
# Create and populate sdk/bin.
- BIN = join(SDK, 'bin')
+ BIN = join(SDK_tmp, 'bin')
os.makedirs(BIN)
# Copy the Dart VM binary into sdk/bin.
@@ -121,7 +127,7 @@
# Create and populate sdk/lib.
#
- LIB = join(SDK, 'lib')
+ LIB = join(SDK_tmp, 'lib')
os.makedirs(LIB)
corelib_dest_dir = join(LIB, 'core')
os.makedirs(corelib_dest_dir)
@@ -351,11 +357,14 @@
# Create and copy tools.
- UTIL = join(SDK, 'tools')
+ UTIL = join(SDK_tmp, 'tools')
Siggi Cherem (dart-lang) 2011/12/06 18:58:42 UTILS -> TOOLS or 'tools' -> 'utils'?
os.makedirs(UTIL)
copytree(join(HOME, 'utils', 'dartdoc'), join(UTIL, 'dartdoc'),
ignore=ignore_patterns('.svn'))
+ copytree(SDK_tmp, SDK)
+ rmtree(SDK_tmp)
+
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