Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 1.42 KB

README.md

File metadata and controls

62 lines (43 loc) · 1.42 KB

KTreeSitter Language Grammar - GraphQL

KTreeSitter GraphQL Language

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.

Use

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.

Manual Build (not required)

The tree-sitter-graphql directory

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

To build a Kotlin or JVM library

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