tree-sitter/crates/generate/build.rs
bbb651 9593737871 build(generate): remove tree-sitter dependency
It was only used to share two constants, and balloons its dependencies.

This also makes `generate_parser_for_grammar` work in wasm.
(Tested in `wasm32-wasip2` in wasmtime with the json grammar,
`wasm32-unknown-unknown` running in the same setup exited successfully
so I'm pretty confident it works as well)

Co-authored-by: Amaan Qureshi <contact@amaanq.com>
2025-09-16 03:48:30 -04:00

11 lines
391 B
Rust

use std::{env, fs, path::PathBuf};
fn main() {
// This will always be ran in CI before publishing.
// We don't use a symlink for windows compatibility.
fs::copy(
concat!(env!("CARGO_WORKSPACE_DIR"), "lib/src/parser.h"),
PathBuf::from(env::var("OUT_DIR").expect("OUT_DIR should be set")).join("parser.h"),
)
.expect("failed to copy parser.h template");
}