diff options
author | Jaideep Bajwa <bjaideep@ca.ibm.com> | 2016-11-01 02:53:37 -0400 |
---|---|---|
committer | Michael Dawson <michael_dawson@ca.ibm.com> | 2016-11-09 17:34:22 -0500 |
commit | 4aca347527fecab0a394cc39ffdf75c76c794fe5 (patch) | |
tree | 573c7a1c936eef4591ebaa44e3db3e0c93fc2f89 | |
parent | d548d28f516ffee5da30f645245069218a5833d0 (diff) | |
download | android-node-v8-4aca347527fecab0a394cc39ffdf75c76c794fe5.tar.gz android-node-v8-4aca347527fecab0a394cc39ffdf75c76c794fe5.tar.bz2 android-node-v8-4aca347527fecab0a394cc39ffdf75c76c794fe5.zip |
v8: update make-v8.sh to use git
google build tool gclient doesn't support
svn anymore. Updating v8 build script to use
git instead.
PR-URL: https://github.com/nodejs/node/pull/9393
Reviewed By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
-rw-r--r-- | Makefile | 2 | ||||
-rwxr-xr-x | tools/make-v8.sh | 49 |
2 files changed, 30 insertions, 21 deletions
@@ -112,7 +112,7 @@ cctest: all @out/$(BUILDTYPE)/$@ v8: - tools/make-v8.sh v8 + tools/make-v8.sh $(MAKE) -C deps/v8 $(V8_ARCH).$(BUILDTYPE_LOWER) $(V8_BUILD_OPTIONS) test: all diff --git a/tools/make-v8.sh b/tools/make-v8.sh index f6efb66a56..786171facf 100755 --- a/tools/make-v8.sh +++ b/tools/make-v8.sh @@ -1,38 +1,47 @@ #!/bin/bash - -git_origin=$(git config --get remote.origin.url | sed 's/.\+[\/:]\([^\/]\+\/[^\/]\+\)$/\1/') -git_branch=$(git rev-parse --abbrev-ref HEAD) -v8ver=${1:-v8} #default v8 -svn_prefix=https://github.com -svn_path="$svn_prefix/$git_origin/branches/$git_branch/deps/$v8ver" -#svn_path="$git_origin/branches/$git_branch/deps/$v8ver" -gclient_string="solutions = [{'name': 'v8', 'url': '$svn_path', 'managed': False}]" +# Get V8 branch from v8/include/v8-version.h +MAJOR=$(grep V8_MAJOR_VERSION deps/v8/include/v8-version.h | cut -d ' ' -f 3) +MINOR=$(grep V8_MINOR_VERSION deps/v8/include/v8-version.h | cut -d ' ' -f 3) +BRANCH=$MAJOR.$MINOR # clean up if someone presses ctrl-c trap cleanup INT function cleanup() { trap - INT - rm .gclient || true rm .gclient_entries || true rm -rf _bad_scm/ || true - - #if v8ver isn't v8, move the v8 folders - #back to what they were - if [ "$v8ver" != "v8" ]; then - mv v8 $v8ver - mv .v8old v8 - fi + find v8 -name ".git" | xargs rm -rf || true + echo "git cleanup" + git reset --hard HEAD + git clean -fdq + # unstash local changes + git stash pop exit 0 } cd deps -echo $gclient_string > .gclient -if [ "$v8ver" != "v8" ]; then - mv v8 .v8old - mv $v8ver v8 +# stash local changes +git stash +rm -rf v8 + +echo "Fetching V8 from chromium.googlesource.com" +fetch v8 +if [ "$?" -ne 0 ]; then + echo "V8 fetch failed" + exit 1 fi +echo "V8 fetched" + +cd v8 + +echo "Checking out branch:$BRANCH" +git checkout remotes/branch-heads/$BRANCH + +echo "Sync dependencies" gclient sync + +cd .. cleanup |