2018-07-04 09:04:59 -04:00
|
|
|
#!/usr/bin/env python
|
2018-07-13 03:24:07 -04:00
|
|
|
# Only run this script if you are changing Deno's dependencies.
|
2018-07-04 09:04:59 -04:00
|
|
|
|
|
|
|
import os
|
2018-07-08 02:18:14 -04:00
|
|
|
from os.path import join
|
2018-07-08 02:24:29 -04:00
|
|
|
from util import run, remove_and_symlink
|
2018-07-04 09:04:59 -04:00
|
|
|
|
|
|
|
root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
2018-07-08 02:18:14 -04:00
|
|
|
third_party_path = join(root_path, "third_party")
|
2018-07-04 09:04:59 -04:00
|
|
|
|
2018-07-08 02:24:29 -04:00
|
|
|
try:
|
|
|
|
os.makedirs(third_party_path)
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
os.chdir(third_party_path)
|
2018-07-13 03:24:07 -04:00
|
|
|
|
|
|
|
# Run yarn to install JavaScript dependencies.
|
|
|
|
remove_and_symlink("../package.json", "package.json")
|
|
|
|
remove_and_symlink("../yarn.lock", "yarn.lock")
|
2018-07-08 02:24:29 -04:00
|
|
|
run(["yarn"])
|
2018-07-13 03:24:07 -04:00
|
|
|
# Run cargo to install Rust dependencies.
|
|
|
|
run(["cargo", "fetch", "--manifest-path=" + root_path + "/Cargo.toml"],
|
2018-07-18 20:00:53 -04:00
|
|
|
envs={'CARGO_HOME': third_party_path + '/rust_crates'})
|
2018-07-13 03:24:07 -04:00
|
|
|
# Run gclient to install other dependencies.
|
|
|
|
run(["gclient", "sync", "--reset", "--shallow", "--no-history", "--nohooks"],
|
|
|
|
envs={'GCLIENT_FILE': root_path + "/gclient_config.py"})
|
|
|
|
# TODO(ry) Is it possible to remove these symlinks?
|
2018-07-20 21:52:00 -04:00
|
|
|
remove_and_symlink("v8/third_party/googletest", "googletest", True)
|
|
|
|
remove_and_symlink("v8/third_party/jinja2", "jinja2", True)
|
|
|
|
remove_and_symlink("v8/third_party/llvm-build", "llvm-build", True)
|
|
|
|
remove_and_symlink("v8/third_party/markupsafe", "markupsafe", True)
|
2018-07-13 03:24:07 -04:00
|
|
|
|
|
|
|
# To update the deno_third_party git repo after running this, try the following:
|
|
|
|
# cd third_party
|
|
|
|
# find . -type f | grep -v "\.git" | xargs -I% git add -f --no-warn-embedded-repo "%"
|