File tree Expand file tree Collapse file tree 4 files changed +33
-7
lines changed
build-logic/src/main/kotlin Expand file tree Collapse file tree 4 files changed +33
-7
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ kotlin {
5050 nativeMain {
5151 dependencies {
5252 api(libs.ktor.client.cio)
53+ api(libs.kaml)
5354 api(libs.kmp.appdirs)
5455 api(libs.kfswatch)
5556 // api(libs.arrow.suspendapp.ktor)
Original file line number Diff line number Diff line change 1+ import com.charleskorn.kaml.Yaml
12import dev.suresh.Greeting
23import dev.suresh.flow.timerComposeFlow
34import dev.suresh.http.MediaApiClient
45import kotlin.reflect.typeOf
56import kotlin.time.Duration
67import kotlinx.coroutines.flow.take
78import kotlinx.coroutines.runBlocking
9+ import kotlinx.serialization.Serializable
810
911data class ProcessResult (val code : Int , val rawOutput : String? )
1012
@@ -40,8 +42,26 @@ fun main(args: Array<String>): Unit = runBlocking {
4042 // MultiplatformSystem.readEnvironmentVariable()
4143
4244 val client = MediaApiClient ()
43- val images = client.images()
44- println (" Found ${images.size} images" )
45+ try {
46+ val images = client.images()
47+ println (" Found ${images.size} images" )
48+ } catch (e: Exception ) {
49+ e.printStackTrace()
50+ }
51+
52+ @Serializable data class Team (val leader : String , val members : List <String >)
53+
54+ val yaml =
55+ Yaml .default.decodeFromString<Team >(
56+ """
57+ leader: Amy
58+ members:
59+ - Bob
60+ - Cindy
61+ - Dan
62+ """
63+ .trimIndent())
64+ println (yaml)
4565}
4666
4767inline fun <reified T > prop (prop : T ): String {
Original file line number Diff line number Diff line change @@ -74,10 +74,9 @@ dokka {
7474 separateInheritedMembers = false
7575 mergeImplicitExpectActualDeclarations = false
7676
77- // val rootPath = rootProject.rootDir
78- // customAssets.from(rootPath.resolve("app-logo.svg"))
79- // customStyleSheets.from(rootPath.resolve("logo-styles.css"))
80- // templatesDir = rootProject.file("dokka-templates")
77+ // customAssets.from(rootDir.resolve("app-logo.svg"))
78+ // customStyleSheets.from(rootDir.resolve("logo-styles.css"))
79+ // templatesDir = rootDir.resolve("dokka-templates")
8180 }
8281}
8382
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ kopy = "0.12.0+2.0.21"
4646poko = " 0.17.2"
4747mappie = " 0.8.0"
4848akkurate = " 0.10.0"
49+ kaml = " 0.62.0"
50+ snakeyaml-engine-kmp = " 3.0.3"
4951konsist = " 0.16.1"
5052karakum = " 1.0.0-alpha.40-K2"
5153seskar = " 3.43.0"
@@ -91,7 +93,7 @@ logback-tyler = "1.0.0"
9193log4j = " 3.0.0-beta2"
9294jmh = " 1.37"
9395mrjar = " 0.1.1"
94- ktfmt = " 0.52 "
96+ ktfmt = " 0.53 "
9597google-javaformat = " 1.24.0"
9698palantir-javaformat = " 2.50.0"
9799google-auto-service = " 1.1.1"
@@ -432,6 +434,10 @@ expiringmap = { module = "net.jodah:expiringmap"
432434password4j = { module = " com.password4j:password4j" , version.ref = " password4j" }
433435otp-java = { module = " com.github.bastiaanjansen:otp-java" , version.ref = " otp" }
434436
437+ # Yaml
438+ kaml = { module = " com.charleskorn.kaml:kaml" , version.ref = " kaml" }
439+ snakeyaml-engine-kmp = { module = " it.krzeminski:snakeyaml-engine-kmp" , version.ref = " snakeyaml-engine-kmp" }
440+
435441# Database IDs
436442sqids = { module = " org.sqids:sqids" , version.ref = " sqids" }
437443tsid = { module = " io.hypersistence:hypersistence-tsid" , version.ref = " tsid" }
You can’t perform that action at this time.
0 commit comments