Configure vendor/ for packaging

ida_star
Wilfred Hughes 2021-08-24 01:02:32 +07:00
parent 5d67ad3bea
commit efcb02c56c
13 changed files with 34 additions and 10 deletions

@ -7,6 +7,14 @@ license = "MIT"
version = "0.7.0" version = "0.7.0"
authors = ["Wilfred Hughes <me@wilfred.me.uk>"] authors = ["Wilfred Hughes <me@wilfred.me.uk>"]
edition = "2018" edition = "2018"
include = [
"build.rs",
"src/",
"vendor/**/*.c",
"vendor/**/*.h",
"vendor/**/*.cc",
"README.md",
]
[dependencies] [dependencies]
regex = "1" regex = "1"

@ -98,9 +98,15 @@ Add the tree-sitter-FOO git repository as a subtree.
``` ```
$ git subtree add --prefix=vendor/tree-sitter-elisp git@github.com:Wilfred/tree-sitter-elisp.git main $ git subtree add --prefix=vendor/tree-sitter-elisp git@github.com:Wilfred/tree-sitter-elisp.git main
``` ```
Add a symlink to the C source directory (Cargo will not include the
parent directory when packaging, because the parent has a `Cargo.toml`).
```
$ cd vendor
$ ln -s tree-sitter-elisp/src tree-sitter-elisp-src
```
Update `build.rs` and `tree_sitter_parser.rs` to include the Update `build.rs` and `tree_sitter_parser.rs` to include the
definitions for the new parser. definitions for the new parser.

@ -35,33 +35,33 @@ fn main() {
// Only rerun if files in the vendor/ directory change. // Only rerun if files in the vendor/ directory change.
println!("cargo:rerun-if-changed=vendor"); println!("cargo:rerun-if-changed=vendor");
build("tree-sitter-clojure", "vendor/tree-sitter-clojure/src", &[]); build("tree-sitter-clojure", "vendor/tree-sitter-clojure-src", &[]);
build( build(
"tree-sitter-css", "tree-sitter-css",
"vendor/tree-sitter-css/src", "vendor/tree-sitter-css-src",
&["scanner.c"], &["scanner.c"],
); );
build("tree-sitter-elisp", "vendor/tree-sitter-elisp/src", &[]); build("tree-sitter-elisp", "vendor/tree-sitter-elisp-src", &[]);
build("tree-sitter-go", "vendor/tree-sitter-go/src", &[]); build("tree-sitter-go", "vendor/tree-sitter-go-src", &[]);
build( build(
"tree-sitter-javascript", "tree-sitter-javascript",
"vendor/tree-sitter-javascript/src", "vendor/tree-sitter-javascript-src",
&["scanner.c"], &["scanner.c"],
); );
build("tree-sitter-json", "vendor/tree-sitter-json/src", &[]); build("tree-sitter-json", "vendor/tree-sitter-json-src", &[]);
build( build(
"tree-sitter-ocaml", "tree-sitter-ocaml",
"vendor/tree-sitter-ocaml/ocaml/src", "vendor/tree-sitter-ocaml-src/ocaml/src",
&["scanner.cc"], &["scanner.cc"],
); );
build( build(
"tree-sitter-ocaml-interface", "tree-sitter-ocaml-interface",
"vendor/tree-sitter-ocaml/interface/src", "vendor/tree-sitter-ocaml-src/interface/src",
&["scanner.cc"], &["scanner.cc"],
); );
build( build(
"tree-sitter-rust", "tree-sitter-rust",
"vendor/tree-sitter-rust/src", "vendor/tree-sitter-rust-src",
&["scanner.c"], &["scanner.c"],
); );
} }

@ -0,0 +1 @@
tree-sitter-clojure/src

@ -0,0 +1 @@
tree-sitter-css/src

@ -0,0 +1 @@
tree-sitter-elisp/src

@ -0,0 +1 @@
tree-sitter-go/src

@ -0,0 +1 @@
tree-sitter-javascript/src

@ -0,0 +1 @@
tree-sitter-json/src

@ -0,0 +1 @@
../tree-sitter-ocaml/common

@ -0,0 +1 @@
../tree-sitter-ocaml/interface

@ -0,0 +1 @@
../tree-sitter-ocaml/ocaml

@ -0,0 +1 @@
tree-sitter-rust/src