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

Unified Diff: bin/sync-and-gyp

Issue 1035003004: tools: add sync-and-gyp script (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-03-27 (Friday) 09:40:16 EDT Created 5 years, 9 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
new file mode 100755
index 0000000000000000000000000000000000000000..a2ba34358c86025349d15f1eb66f6f5c2e28757a
--- /dev/null
+++ b/bin/sync-and-gyp
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+# Copyright 2015 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This script will update Skia's dependenciess as necessary and run
+# gyp if needed.
+
+# Example usage (assumes Posix-standard shell, git installed):
+#
+# git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
+# export PATH="${PWD}/depot_tools:${PATH}"
+# git clone https://skia.googlesource.com/skia
+# cd skia
+# bin/sync-and-gyp && ninja -C out/Debug
+# out/Debug/dm
+#
+# Once changes are made to DEPS or gyp/ or the source, recompile Skia with:
+#
+# ${skiadir}/bin/sync-and-gyp && ninja -C ${skiadir}/out/Debug
+
+cd "$(dirname "$0")/.."
+
+if ! [ -f .gclient ] ; then
+ gclient config --name . --unmanaged 'https://skia.googlesource.com/skia'
+fi
+
+if ! [ -f DEPS ]; then
+ echo DEPS file missing >&2
+ exit 1
+fi
+
+if [ "$(git hash-object DEPS)" != "$(git config sync-deps.last)" ] ; then
+ gclient sync || exit
+ git config sync-deps.last "$(git hash-object DEPS)"
+fi
+
+function catifexists() { if [ -f "$1" ]; then cat "$1"; fi; }
+
+function gyp_hasher() {
+ {
+ echo "$GYP_GENERATORS"
+ echo "$GYP_DEFINES"
+ find gyp -type f -print -exec git hash-object {} \;
+ } | git hash-object --stdin
+}
+
+: ${SKIA_OUT:=out}
+GYP_HASH=$(gyp_hasher)
+HASH_PATH="${SKIA_OUT}/gyp_hash"
+if [ "$GYP_HASH" != "$(catifexists "$HASH_PATH")" ]; then
+ ./gyp_skia || exit
+ echo "$GYP_HASH" > "$HASH_PATH"
+fi
« 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