mirror of
https://github.com/D-Modem/app.git
synced 2026-11-28 17:38:05 -08:00
PeerLine moves to shared/'s common Kotlin: its connections (Duplex) on Source and Sink, its threads coroutines' I/O threads (background()), a latch, atomicfu's locks and atomics; the transports (TCP, Bluetooth, the mobile call) and the native modem's line stay the app's, on the same interface. The fax test page (a frame, bars, dashes, a checkerboard) is shared code (FaxTestPage): the app's fax tests and T4Test both have it. (The fax move left the app's fax tests without it: they compile again.) PeerLoopbackTest (common: the JVM and native): two phones' lines in memory, each modem answering every sample with its own; the call rung, answered and heard both ways after the exchange's tones, a third phone busy, the hang-up. The app's tests on two real modems pass on the shared code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
42 lines
1.3 KiB
Kotlin
42 lines
1.3 KiB
Kotlin
// SPDX-License-Identifier: AGPL-3.0-only
|
|
// Copyright (C) 2026 Neo-Desktop
|
|
//
|
|
// What the Android app and the iOS app share, in Kotlin Multiplatform:
|
|
// the terminal's emulator (VT/xterm, its screen, Sixel, the character
|
|
// sets, the keys, the characters' widths, the themes), the file
|
|
// transfers (X/Y/ZMODEM, Kermit), PPP, fax, the line to another phone,
|
|
// and the I/O they're on (io/). The Android app
|
|
// has its JVM side; the iOS app its framework (iOS devices, simulator).
|
|
plugins {
|
|
alias(libs.plugins.kotlin.multiplatform)
|
|
}
|
|
|
|
kotlin {
|
|
jvm {
|
|
compilerOptions {
|
|
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
|
|
}
|
|
}
|
|
// (Kotlin/Native on Linux: the common tests run native here and in CI, as on iOS)
|
|
linuxX64()
|
|
listOf(iosArm64(), iosSimulatorArm64()).forEach {
|
|
it.binaries.framework {
|
|
baseName = "DModemShared"
|
|
isStatic = true
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
commonMain.dependencies {
|
|
implementation(libs.kotlinx.coroutines.core)
|
|
implementation(libs.kotlinx.atomicfu)
|
|
}
|
|
commonTest.dependencies {
|
|
implementation(kotlin("test"))
|
|
}
|
|
jvmTest.dependencies {
|
|
implementation(libs.junit)
|
|
}
|
|
}
|
|
}
|