This is the Kotlin binding of the GraphQL Tree-sitter grammar written by dralletje. The grammar is not modified. Its license follows the original dralletje's repository -- ISC.
In build.gradle.kts, put:
implementation("io.github.tree-sitter:ktreesitter:0.23.0")
implementation("io.github.sunny-chung:ktreesitter-graphql:1.0.0.0")
For how to load and use the libraries, please refer to this README.
The tree-sitter-graphql
directory is made by the following commands:
mkdir tree-sitter-graphql
cd tree-sitter-graphql
tree-sitter init
cp ../tree-sitter-graphql-original/grammar.js ./
tree-sitter generate
For macOS / Linux,
gradle generateGrammarFilesEnhanced
pushd build/generated/
cmake CMakeLists.txt
make
mkdir src/resources
cp lib* src/resources/
popd
gradle assemble
For Windows,
gradle generateGrammarFilesEnhanced
cd build/generated/
cmake CMakeLists.txt
cmake --build . --target INSTALL --config Release
mkdir src/resources
cp Release/*.dll src/resources/
cd ../..
gradle assemble