Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app-desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ dependencies {
implementation(project(":core"))
implementation(compose.desktop.currentOs)
implementation(compose.material3)

// SLF4J logging implementation
implementation(libs.slf4j.simple)
}

compose.desktop {
application {
mainClass = "llc.lookatwhataicando.codeoba.desktop.MainKt"

jvmArgs += listOf(
"--enable-native-access=ALL-UNNAMED"
)

nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "Codeoba"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package llc.lookatwhataicando.codeoba.core.data.realtime

import io.ktor.client.HttpClient
import io.ktor.client.engine.cio.CIO
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
import io.ktor.serialization.kotlinx.json.json
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonObject
import llc.lookatwhataicando.codeoba.core.domain.realtime.ConnectionState
import llc.lookatwhataicando.codeoba.core.domain.realtime.RealtimeConfig
Expand Down Expand Up @@ -47,8 +51,15 @@ actual class RealtimeClientImpl actual constructor() : RealtimeClientBase() {
throwable?.printStackTrace()
}

// HTTP client for Desktop (uses default engine)
override val httpClient = HttpClient()
// HTTP client for Desktop (uses CIO engine with ContentNegotiation for JSON)
override val httpClient = HttpClient(CIO) {
install(ContentNegotiation) {
json(Json {
ignoreUnknownKeys = true
isLenient = true
})
}
}

private val _audioFrames = MutableSharedFlow<ByteArray>(replay = 0)
actual override val audioFrames: Flow<ByteArray> = _audioFrames.asSharedFlow()
Expand Down
6 changes: 6 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ kotlinx-serialization-json = "1.9.0"
# Networking
ktor = "3.3.3"

# Logging
slf4j = "2.0.16"

# WebRTC
webrtc-android = "137.7151.05"

Expand Down Expand Up @@ -45,6 +48,9 @@ ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }

# Logging
slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" }

# AndroidX
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity-compose" }
androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle-viewmodel-compose" }
Expand Down
Loading