diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-09-28 18:35:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-28 18:35:02 +0200 |
commit | e933426299b44db6715f6f61ab76aee57478110e (patch) | |
tree | ffca71781f4e06460fa9b98be68cb02a23d5e0bd /ci | |
parent | 0d9a3c86a1c7143187398e6cb6005ed06a5e2fde (diff) | |
parent | 9fa850991dbe8984996afdc149b5b32dc248197e (diff) | |
download | rneovim-e933426299b44db6715f6f61ab76aee57478110e.tar.gz rneovim-e933426299b44db6715f6f61ab76aee57478110e.tar.bz2 rneovim-e933426299b44db6715f6f61ab76aee57478110e.zip |
Merge pull request #10124 from bfredl/tree-sitter-api
Tree-sitter step 1: vendor runtime lib + add lua API
Diffstat (limited to 'ci')
-rw-r--r-- | ci/build.ps1 | 22 | ||||
-rwxr-xr-x | ci/install.sh | 20 | ||||
-rwxr-xr-x | ci/run_tests.sh | 2 |
3 files changed, 44 insertions, 0 deletions
diff --git a/ci/build.ps1 b/ci/build.ps1 index d533d7b4e0..4e1a69376b 100644 --- a/ci/build.ps1 +++ b/ci/build.ps1 @@ -94,6 +94,28 @@ npm.cmd install -g neovim Get-Command -CommandType Application neovim-node-host.cmd npm.cmd link neovim +#npm.cmd install -g tree-sitter-cli +#npm.cmd link tree-sitter-cli + +mkdir c:\treesitter +$env:TREE_SITTER_DIR = "c:\treesitter" +#$env:PATH = "c:\treesitter;$env:PATH" +$client = new-object System.Net.WebClient +cd c:\treesitter + +if ($bits -eq 32) { + $client.DownloadFile("https://github.com/tree-sitter/tree-sitter/releases/download/0.15.5/tree-sitter-windows-x86.gz","c:\treesitter\tree-sitter-cli.gz") +} +elseif ($bits -eq 64) { + $client.DownloadFile("https://github.com/tree-sitter/tree-sitter/releases/download/0.15.5/tree-sitter-windows-x64.gz","c:\treesitter\tree-sitter-cli.gz") +} +python -c "import gzip, shutil; f1,f2 = gzip.open('tree-sitter-cli.gz', 'rb'), open('tree-sitter.exe', 'wb'); shutil.copyfileobj(f1, f2); f2.close()" + +$client.DownloadFile("https://codeload.github.com/tree-sitter/tree-sitter-c/zip/v0.15.2","c:\treesitter\tree_sitter_c.zip") +Expand-Archive c:\treesitter\tree_sitter_c.zip -DestinationPath c:\treesitter\ +cd c:\treesitter\tree-sitter-c-0.15.2 +c:\treesitter\tree-sitter.exe test + function convertToCmakeArgs($vars) { return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" } } diff --git a/ci/install.sh b/ci/install.sh index cda9a11f08..b96cf3c073 100755 --- a/ci/install.sh +++ b/ci/install.sh @@ -24,3 +24,23 @@ gem install --no-document --version ">= 0.8.0" neovim echo "Install neovim npm package" npm install -g neovim npm link neovim + +echo "Install tree-sitter npm package" +npm install -g tree-sitter-cli +npm link tree-sitter-cli + +echo "Install tree-sitter c parser" +curl "https://codeload.github.com/tree-sitter/tree-sitter-c/tar.gz/v0.15.2" -o tree_sitter_c.tar.gz +tar xf tree_sitter_c.tar.gz +cd tree-sitter-c-0.15.2 +export TREE_SITTER_DIR=$HOME/tree-sitter-build/ +mkdir -p $TREE_SITTER_DIR/bin + +if [[ "$BUILD_32BIT" != "ON" ]]; then + # builds c parser in $HOME/tree-sitter-build/bin/c.(so|dylib) + tree-sitter test +else + # no tree-sitter binary for 32bit linux, so fake it (no tree-sitter unit tests) + cd src/ + gcc -m32 -o $TREE_SITTER_DIR/bin/c.so -shared parser.c -I. +fi diff --git a/ci/run_tests.sh b/ci/run_tests.sh index c175910da5..6b2f69293c 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -19,6 +19,8 @@ exit_suite --continue enter_suite tests +export TREE_SITTER_DIR=$HOME/tree-sitter-build/ + if test "$CLANG_SANITIZER" != "TSAN" ; then # Additional threads are only created when the builtin UI starts, which # doesn't happen in the unit/functional tests |