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

Unified Diff: bin/sync-and-gyp

Issue 1705063002: bin/sync-and-gyp: pass --deps='...' to `gclient sync`. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-02-17 (Wednesday) 11:02:32 EST Created 4 years, 10 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: bin/sync-and-gyp
diff --git a/bin/sync-and-gyp b/bin/sync-and-gyp
index 906b7671ba6850eb48ae7723c804c70eeb32065a..ac6b8392b23b1cf1285772ee773683cf9754d523 100755
--- a/bin/sync-and-gyp
+++ b/bin/sync-and-gyp
@@ -23,14 +23,21 @@
#
# python bin/sync-and-gyp
+# To retreive and use all optional deps:
+#
+# python bin/sync-and-gyp --deps=all
+# ninja -C out/Debug && out/Debug/dm
+
import fnmatch
import hashlib
-import subprocess
import os
+import subprocess
import sys
skia_dir = os.path.join(os.path.dirname(__file__), os.pardir)
+skia_opt_deps = [arg for arg in sys.argv[1:] if arg.startswith('--deps=')]
+
skia_out = os.environ.get("SKIA_OUT")
if skia_out:
skia_out = os.path.abspath(skia_out)
@@ -47,6 +54,7 @@ if not os.path.isfile('DEPS'):
deps_hasher = hashlib.sha1()
with open('DEPS', 'r') as f:
deps_hasher.update(f.read())
+deps_hasher.update(repr(skia_opt_deps))
deps_hash = deps_hasher.hexdigest()
current_deps_hash = None
if os.path.isfile('.deps_sha1'):
@@ -71,8 +79,10 @@ if current_deps_hash != deps_hash:
if not os.path.isfile('.gclient'):
with open('.gclient', 'w') as o:
o.write(default_gclient_config)
+ gclient_sync_command = ['gclient', 'sync'] + skia_opt_deps
try:
- subprocess.check_call(['gclient', 'sync'])
+ sys.stdout.write('%r\n' % gclient_sync_command)
+ subprocess.check_call(gclient_sync_command)
except:
sys.stderr.write('\n`gclient sync` failed.\n')
os.remove('.deps_sha1') # Unknown state.
« 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