Kotlin multiplatform code-generator for typed tree data class structures.
Generate builders for your immutable data classes. Annotate class:
@Buildable
data class Root(
//...
)
and use builders:
Root::class.build {
branch {
leaf = "My value"
}
}
See more in data-tree-building.md
Generate builders for your immutable data classes.
Annotate class:
@PathReflection
data class Root(
//...
)
and automatically gather information about the path to the value:
root.withPath().branch.leaf.path().jsonPath // will return "$.branch.leaf"
See more in path-reflection.md
All @Buildable
classes can be dynamically accessed.
Annotate class:
@Buildable
data class Item(
val value: String,
val list: List<Map<String,String>>
// ...
)
and access data dynamically with generated accessors:
item.dynamicAccessor["value"] // returns item.value
item.dynamicAccessor["$.list[2]['element']"] // returns item.list[2]["element"]
See more in dynamic-access.md
- Have open source repositories connected to project:
buildscript {
repositories {
gradlePluginPortal()
// ...
}
}
repositories {
mavenCentral()
// ...
}
- Add buildata plugin to your build
plugins {
kotlin("multiplatform") version "1.9.20"
kotlin("jvm") version "1.9.20" // alternatively
// ...
id("io.github.virelion.buildata") version <LIBRARY_VERSION>
}
- Add buildata runtime to your dependencies
kotlin {
// ...
sourceSets {
val commonMain by getting {
dependencies {
implementation("io.github.virelion.buildata:buildata-runtime:<LIBRARY_VERSION>")
}
}
// ...
}
}