This little project provides Kotlin bindings for the popular tree-sitter library. Currently it only supports the Kotlin JVM target, but Kotlin native is on the roadmap (see #3).
It currently ships forks of tree-sitter
itself,
as well as tree-sitter-cpp
.
We might want to include more languages (see #2).
Just run ./gradlew build
, this should build everything you need into a packaged jar, including the necessary native libraries.
The latest release is available from GitHub Packages.
For build.gradle.kts
:
repositories {
maven {
name = "0x6675636b796f75676974687562/kotlintree"
url = uri("https://maven.pkg.github.com/0x6675636b796f75676974687562/kotlintree")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
}
}
}
For settings.gradle.kts
:
dependencyResolutionManagement {
repositories {
maven {
name = "0x6675636b796f75676974687562/kotlintree"
url = uri("https://maven.pkg.github.com/0x6675636b796f75676974687562/kotlintree")
credentials {
username = providers.gradleProperty("gpr.user").orNull
?: System.getenv("GITHUB_ACTOR")
password = providers.gradleProperty("gpr.key").orNull
?: System.getenv("GITHUB_TOKEN")
}
}
}
}
Then add the dependency as usual:
dependencies {
implementation("io.github.oxisto:kotlin-tree-jna:0.0.2")
}