diff --git a/.travis.yml b/.travis.yml index 2a45567820..6314c42ff5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,8 +28,7 @@ install: - curl -sSf https://sh.rustup.rs | sh -s -- -y - export PATH=$HOME/.cargo/bin:$PATH - rustc --version - - (cd js; yarn) - - (cd third_party; gclient sync -j2 --no-history) + - ./tools/build_third_party.py # ccache needs the custom LLVM to be in PATH and other variables. - export PATH=`pwd`/third_party/llvm-build/Release+Asserts/bin:$PATH - export CCACHE_CPP2=yes diff --git a/README.md b/README.md index 7372a0d94d..a15e376acb 100644 --- a/README.md +++ b/README.md @@ -73,14 +73,11 @@ You need [rust](https://www.rust-lang.org/en-US/install.html) installed. You need [ccache](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/ccache) installed. -Fetch packages and v8: -```bash -(cd third_party; gclient sync --no-history) -``` +Fetch the third party dependencies. -Install the javascript deps. + ./tools/build_third_party.py - (cd js; yarn install) +Generate ninja files. gn gen out/Debug --args='cc_wrapper="ccache" is_debug=true ' diff --git a/js/node_modules b/js/node_modules new file mode 120000 index 0000000000..c46f1f34b2 --- /dev/null +++ b/js/node_modules @@ -0,0 +1 @@ +../third_party/node_modules \ No newline at end of file diff --git a/third_party/package.json b/third_party/package.json new file mode 120000 index 0000000000..581e2de97d --- /dev/null +++ b/third_party/package.json @@ -0,0 +1 @@ +../js/package.json \ No newline at end of file diff --git a/js/yarn.lock b/third_party/yarn.lock similarity index 100% rename from js/yarn.lock rename to third_party/yarn.lock diff --git a/tools/build_third_party.py b/tools/build_third_party.py new file mode 100755 index 0000000000..caaf3bfafa --- /dev/null +++ b/tools/build_third_party.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python +# This script updates the third party dependencies of deno. +# - Get Depot Tools and make sure it's in your path. +# http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up +# - You need yarn installed as well. +# https://yarnpkg.com/lang/en/docs/install/ +# Use //gclient_config.py to modify the git deps. +# Use //js/package.json to modify the npm deps. + +import os +import subprocess +import argparse + +root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) +third_party_path = os.path.join(root_path, "third_party") +script_name = "build_third_party.py" + +parser = argparse.ArgumentParser(description=""" +This script updates the third party dependencies of deno. +""") +parser.parse_args() + +def main(): + os.chdir(third_party_path) + run(["gclient", "sync", "--no-history"]) + run(["yarn"]) + print "Done (" + script_name + ")" + +def run(args): + print " ".join(args) + env = os.environ.copy() + subprocess.check_call(args, env=env) + +if '__main__' == __name__: + main()