Add tools/build_third_party.py (#328)

Fixes #312
This commit is contained in:
Yoshiya Hinosawa 2018-07-04 22:04:59 +09:00 committed by Ryan Dahl
parent 15d6541d4d
commit 2060bc939d
6 changed files with 41 additions and 8 deletions

View File

@ -28,8 +28,7 @@ install:
- curl -sSf https://sh.rustup.rs | sh -s -- -y - curl -sSf https://sh.rustup.rs | sh -s -- -y
- export PATH=$HOME/.cargo/bin:$PATH - export PATH=$HOME/.cargo/bin:$PATH
- rustc --version - rustc --version
- (cd js; yarn) - ./tools/build_third_party.py
- (cd third_party; gclient sync -j2 --no-history)
# ccache needs the custom LLVM to be in PATH and other variables. # ccache needs the custom LLVM to be in PATH and other variables.
- export PATH=`pwd`/third_party/llvm-build/Release+Asserts/bin:$PATH - export PATH=`pwd`/third_party/llvm-build/Release+Asserts/bin:$PATH
- export CCACHE_CPP2=yes - export CCACHE_CPP2=yes

View File

@ -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. You need [ccache](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/ccache) installed.
Fetch packages and v8: Fetch the third party dependencies.
```bash
(cd third_party; gclient sync --no-history)
```
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 ' gn gen out/Debug --args='cc_wrapper="ccache" is_debug=true '

1
js/node_modules Symbolic link
View File

@ -0,0 +1 @@
../third_party/node_modules

1
third_party/package.json vendored Symbolic link
View File

@ -0,0 +1 @@
../js/package.json

35
tools/build_third_party.py Executable file
View File

@ -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()