mirror of
https://github.com/AdrianKuta/Tree-Data-Structure.git
synced 2026-06-19 19:00:14 +02:00
BREAKING changes to the core: - treeIterator is now a read-only `val`; added `iterator(order)` and use `asSequence(order)`. - removeChild() only removes a direct child of the receiver; added `detach()` to unhook a node. - addChild() rejects re-parenting and cycles (throws TreeNodeException); detach() first to move. - clear() no longer nulls the receiver's own parent; only removes descendants. - path() returns List<TreeNode<T>>? (null) instead of throwing. Also: - Enable strict explicitApi() across core + both modules; add explicit `public` modifiers. - Update tests for the new contracts + add TreeNodeV4Test; refresh .api baselines. - README + CHANGELOG (with migration notes); bump version to 4.0.0. 47 JVM tests green.
90 lines
2.3 KiB
Kotlin
90 lines
2.3 KiB
Kotlin
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
|
|
|
|
plugins {
|
|
alias(libs.plugins.kotlinMultiplatform)
|
|
alias(libs.plugins.kotlinSerialization)
|
|
alias(libs.plugins.dokka)
|
|
alias(libs.plugins.mavenPublish)
|
|
signing
|
|
}
|
|
|
|
group = "com.github.adriankuta"
|
|
version = rootProject.version
|
|
|
|
mavenPublishing {
|
|
publishToMavenCentral(automaticRelease = false)
|
|
signAllPublications()
|
|
|
|
coordinates("com.github.adriankuta", "tree-structure-serialization", version.toString())
|
|
|
|
pom {
|
|
name.set("Tree Data Structure — kotlinx.serialization")
|
|
description.set("kotlinx.serialization support (TreeNodeDto round-trip) for the tree-structure library.")
|
|
url.set("https://github.com/AdrianKuta/Tree-Data-Structure")
|
|
licenses {
|
|
license {
|
|
name.set("MIT License")
|
|
url.set("https://opensource.org/licenses/MIT")
|
|
distribution.set("repo")
|
|
}
|
|
}
|
|
developers {
|
|
developer {
|
|
id.set("AdrianKuta")
|
|
name.set("Adrian Kuta")
|
|
email.set("adrian.kuta93@gmail.com")
|
|
}
|
|
}
|
|
scm {
|
|
url.set("https://github.com/AdrianKuta/Tree-Data-Structure")
|
|
connection.set("scm:git:https://github.com/AdrianKuta/Tree-Data-Structure.git")
|
|
developerConnection.set("scm:git:ssh://git@github.com/AdrianKuta/Tree-Data-Structure.git")
|
|
}
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
kotlin {
|
|
explicitApi()
|
|
jvmToolchain(21)
|
|
|
|
jvm()
|
|
|
|
js(IR) {
|
|
browser()
|
|
nodejs()
|
|
}
|
|
|
|
@OptIn(ExperimentalWasmDsl::class)
|
|
wasmJs {
|
|
browser()
|
|
nodejs()
|
|
}
|
|
|
|
iosX64()
|
|
iosArm64()
|
|
iosSimulatorArm64()
|
|
|
|
val hostOs = System.getProperty("os.name")
|
|
val isMingwX64 = hostOs.startsWith("Windows")
|
|
when {
|
|
hostOs == "Mac OS X" -> macosX64("native")
|
|
hostOs == "Linux" -> linuxX64("native")
|
|
isMingwX64 -> mingwX64("native")
|
|
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
|
|
}
|
|
|
|
sourceSets {
|
|
commonMain.dependencies {
|
|
api(project(":"))
|
|
api(libs.kotlinx.serialization.json)
|
|
}
|
|
commonTest.dependencies {
|
|
implementation(kotlin("test"))
|
|
}
|
|
}
|
|
}
|