2026-03-23 01:41:39 +02:00
|
|
|
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
|
|
|
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
|
alias(libs.plugins.androidApplication)
|
2026-05-02 00:05:38 +02:00
|
|
|
// alias(libs.plugins.androidx.room)
|
|
|
|
|
alias(libs.plugins.androidx.room3)
|
2026-03-24 04:47:19 +02:00
|
|
|
alias(libs.plugins.kotlinMultiplatform)
|
2026-03-23 01:41:39 +02:00
|
|
|
alias(libs.plugins.composeMultiplatform)
|
|
|
|
|
alias(libs.plugins.composeCompiler)
|
|
|
|
|
alias(libs.plugins.composeHotReload)
|
2026-03-23 02:21:18 +02:00
|
|
|
alias(libs.plugins.kotlinPluginSerialization)
|
2026-03-24 04:47:19 +02:00
|
|
|
alias(libs.plugins.ksp)
|
2026-06-15 14:39:46 +02:00
|
|
|
alias(libs.plugins.sqldelight)
|
2026-03-23 01:41:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
kotlin {
|
2026-03-26 00:20:20 +02:00
|
|
|
compilerOptions {
|
|
|
|
|
freeCompilerArgs.add("-Xexpect-actual-classes")
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-23 01:41:39 +02:00
|
|
|
androidTarget {
|
|
|
|
|
compilerOptions {
|
2026-06-23 13:59:17 +02:00
|
|
|
jvmTarget.set(JvmTarget.JVM_21)
|
2026-03-23 01:41:39 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-04 22:50:59 +02:00
|
|
|
// Declared only on a mac, mirroring the gate lightning-kmp-app's :library applies to its own ios
|
|
|
|
|
// targets. Down the composite chain secp256k1-kmp declares a libsecp256k1 cinterop, which makes
|
|
|
|
|
// gradle switch off klib cross compilation for apple targets, so on a linux/windows host nothing
|
|
|
|
|
// in the build tree offers an ios variant of fr.acinq.phoenix:lightning-kmp-app. Declaring these
|
|
|
|
|
// targets anyway leaves every ios compilation unable to resolve it and fails the build outright.
|
|
|
|
|
// Building an ios binary needs a mac regardless.
|
|
|
|
|
if (org.gradle.internal.os.OperatingSystem.current().isMacOsX) {
|
|
|
|
|
listOf(
|
|
|
|
|
iosArm64(),
|
|
|
|
|
iosSimulatorArm64()
|
|
|
|
|
).forEach { iosTarget ->
|
|
|
|
|
iosTarget.binaries.framework {
|
|
|
|
|
baseName = "ComposeApp"
|
|
|
|
|
isStatic = true
|
|
|
|
|
}
|
2026-03-23 01:41:39 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-16 20:28:05 +03:00
|
|
|
// jvm()
|
2026-03-23 01:41:39 +02:00
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
|
androidMain.dependencies {
|
2026-09-04 23:25:23 +02:00
|
|
|
// The android secp256k1 natives. Nothing pulls these in transitively: lightning-kmp-core
|
|
|
|
|
// publishes no android variant, so the android target resolves it to the jvm one, which
|
|
|
|
|
// asks for secp256k1-kmp-jni-jvm and gets desktop .so/.dylib/.dll files that cannot load
|
|
|
|
|
// on a device. The app has to name the android artifact itself.
|
|
|
|
|
//
|
|
|
|
|
// Resolved from source via the composite build, not from Maven Central -- bitcoin-kmp's
|
|
|
|
|
// settings.gradle.kts substitutes this coordinate for secp256k1-kmp's :jni:android. That
|
|
|
|
|
// matters: the stock artifact has no ChillDKG module, so ChillDKG would compile and then
|
|
|
|
|
// fail with UnsatisfiedLinkError. The version is never resolved; substitution matches on
|
|
|
|
|
// group:name.
|
|
|
|
|
implementation("fr.acinq.secp256k1:secp256k1-kmp-jni-android:0.24.0")
|
|
|
|
|
|
2026-03-23 01:41:39 +02:00
|
|
|
implementation(libs.androidx.activity.compose)
|
2026-05-02 00:05:38 +02:00
|
|
|
// implementation(libs.androidx.room.sqlite.wrapper)
|
2026-03-30 13:14:37 +02:00
|
|
|
implementation(libs.compose.uiToolingPreview)
|
2026-06-15 14:39:46 +02:00
|
|
|
|
|
|
|
|
implementation(libs.sqldelight.android.driver)
|
2026-03-23 01:41:39 +02:00
|
|
|
}
|
|
|
|
|
commonMain.dependencies {
|
2026-04-19 04:30:29 +02:00
|
|
|
implementation(libs.androidx.datastore)
|
2026-04-18 21:58:32 +02:00
|
|
|
implementation(libs.androidx.datastore.preferences)
|
|
|
|
|
|
2026-03-30 13:14:37 +02:00
|
|
|
implementation(libs.androidx.lifecycle.viewmodelCompose)
|
|
|
|
|
implementation(libs.androidx.lifecycle.runtimeCompose)
|
|
|
|
|
|
2026-05-02 00:05:38 +02:00
|
|
|
// implementation(libs.androidx.room.runtime)
|
|
|
|
|
implementation(libs.androidx.room3.runtime)
|
2026-03-30 13:14:37 +02:00
|
|
|
implementation(libs.androidx.sqlite.bundled)
|
|
|
|
|
|
2026-04-21 23:49:54 +02:00
|
|
|
implementation(libs.coil.compose)
|
|
|
|
|
implementation(libs.coil.network.ktor3)
|
2026-04-20 22:57:15 +02:00
|
|
|
|
2026-03-23 01:41:39 +02:00
|
|
|
implementation(libs.compose.runtime)
|
|
|
|
|
implementation(libs.compose.foundation)
|
|
|
|
|
implementation(libs.compose.material3)
|
|
|
|
|
implementation (libs.compose.material.icons.core)
|
|
|
|
|
implementation (libs.compose.material.icons.extended)
|
|
|
|
|
implementation(libs.compose.ui)
|
|
|
|
|
implementation(libs.compose.components.resources)
|
|
|
|
|
implementation(libs.compose.uiToolingPreview)
|
|
|
|
|
|
2026-04-18 21:58:32 +02:00
|
|
|
|
2026-03-23 01:41:39 +02:00
|
|
|
implementation(libs.kermit)
|
|
|
|
|
|
2026-03-30 13:09:49 +02:00
|
|
|
implementation(libs.kotlinx.datetime)
|
2026-03-30 13:14:37 +02:00
|
|
|
implementation(libs.kotlinx.serialization.json)
|
2026-06-15 14:39:46 +02:00
|
|
|
implementation(libs.kotlinx.serialization.cbor)
|
|
|
|
|
|
2026-03-30 13:09:49 +02:00
|
|
|
|
2026-03-27 13:35:29 +02:00
|
|
|
implementation(libs.ktor.client.core)
|
2026-03-30 13:25:19 +02:00
|
|
|
implementation(libs.ktor.client.cio)
|
2026-03-30 13:14:37 +02:00
|
|
|
implementation(libs.ktor.client.websockets)
|
|
|
|
|
implementation(libs.ktor.serialization.kotlinx.json)
|
|
|
|
|
|
2026-06-15 14:39:46 +02:00
|
|
|
|
|
|
|
|
|
2026-08-15 17:07:31 +02:00
|
|
|
// implementation(libs.lightning.kmp.core)
|
|
|
|
|
|
|
|
|
|
// resolved via the lightning-kmp-app composite build (see settings.gradle.kts)
|
|
|
|
|
implementation("fr.acinq.phoenix:lightning-kmp-app:1.0.0")
|
2026-06-15 14:39:46 +02:00
|
|
|
|
|
|
|
|
implementation(libs.navigation.compose)
|
|
|
|
|
|
2026-04-18 02:41:31 +02:00
|
|
|
implementation(libs.okio)
|
|
|
|
|
|
2026-07-01 15:11:31 +02:00
|
|
|
implementation(libs.qrose)
|
2026-06-15 14:39:46 +02:00
|
|
|
|
|
|
|
|
implementation(libs.sqldelight.runtime)
|
|
|
|
|
implementation(libs.sqldelight.coroutines.extensions)
|
|
|
|
|
|
2026-03-30 13:14:37 +02:00
|
|
|
implementation(libs.vitorpamplona.quartz)
|
2026-03-23 01:41:39 +02:00
|
|
|
}
|
|
|
|
|
commonTest.dependencies {
|
|
|
|
|
implementation(libs.kotlin.test)
|
2026-09-05 23:21:52 +02:00
|
|
|
// runTest: the DAO and model layers are suspending, so anything worth
|
|
|
|
|
// asserting about them needs a coroutine to assert it in.
|
|
|
|
|
implementation(libs.kotlinx.coroutinesTest)
|
2026-03-23 01:41:39 +02:00
|
|
|
}
|
|
|
|
|
jvmMain.dependencies {
|
|
|
|
|
implementation(compose.desktop.currentOs)
|
|
|
|
|
implementation(libs.kotlinx.coroutinesSwing)
|
|
|
|
|
}
|
2026-09-04 22:50:59 +02:00
|
|
|
// Only exists when the ios targets above were declared; the default hierarchy template
|
|
|
|
|
// creates this source set from them.
|
|
|
|
|
if (org.gradle.internal.os.OperatingSystem.current().isMacOsX) {
|
|
|
|
|
iosMain.dependencies {
|
|
|
|
|
implementation(libs.sqldelight.native.driver)
|
|
|
|
|
}
|
2026-03-27 13:35:29 +02:00
|
|
|
}
|
2026-03-23 01:41:39 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
android {
|
2026-07-15 01:14:46 +02:00
|
|
|
namespace = "press.mantra.android"
|
2026-03-23 01:41:39 +02:00
|
|
|
compileSdk = libs.versions.android.compileSdk.get().toInt()
|
|
|
|
|
|
2026-06-15 14:39:46 +02:00
|
|
|
buildFeatures {
|
|
|
|
|
buildConfig = true
|
|
|
|
|
}
|
2026-03-23 01:41:39 +02:00
|
|
|
defaultConfig {
|
2026-07-15 01:14:46 +02:00
|
|
|
applicationId = "press.mantra.android"
|
2026-03-23 01:41:39 +02:00
|
|
|
minSdk = libs.versions.android.minSdk.get().toInt()
|
|
|
|
|
targetSdk = libs.versions.android.targetSdk.get().toInt()
|
|
|
|
|
versionCode = 1
|
2026-04-22 22:31:03 +02:00
|
|
|
versionName = "0.1.0"
|
2026-03-23 01:41:39 +02:00
|
|
|
}
|
|
|
|
|
packaging {
|
|
|
|
|
resources {
|
|
|
|
|
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
2026-03-23 02:21:18 +02:00
|
|
|
excludes += "META-INF/versions/9/OSGI-INF/MANIFEST.MF"
|
2026-03-23 01:41:39 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
buildTypes {
|
|
|
|
|
getByName("release") {
|
|
|
|
|
isMinifyEnabled = false
|
|
|
|
|
}
|
2026-03-23 02:21:18 +02:00
|
|
|
getByName("debug") {
|
|
|
|
|
applicationIdSuffix = ".debug"
|
|
|
|
|
versionNameSuffix = "-DEBUG"
|
|
|
|
|
}
|
2026-03-23 01:41:39 +02:00
|
|
|
}
|
|
|
|
|
compileOptions {
|
2026-06-23 13:59:17 +02:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_21
|
|
|
|
|
targetCompatibility = JavaVersion.VERSION_21
|
2026-03-23 01:41:39 +02:00
|
|
|
}
|
2026-09-05 20:21:00 +02:00
|
|
|
testOptions {
|
|
|
|
|
unitTests {
|
|
|
|
|
// Quartz logs through android.util.Log on the error paths -- parsing a
|
|
|
|
|
// malformed event, for one. Unmocked, those methods throw, so a test
|
|
|
|
|
// covering such a path fails on the log line rather than on what it
|
|
|
|
|
// came to check. Default values let the code under test carry on.
|
|
|
|
|
isReturnDefaultValues = true
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-03-23 01:41:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
|
debugImplementation(libs.compose.uiTooling)
|
2026-05-02 00:05:38 +02:00
|
|
|
// ksp(libs.androidx.room3.compiler)
|
|
|
|
|
add("kspAndroid", libs.androidx.room3.compiler)
|
2026-09-04 22:50:59 +02:00
|
|
|
// These configurations only exist when the ios targets are declared, which the kotlin block
|
|
|
|
|
// above does only on a mac.
|
|
|
|
|
if (org.gradle.internal.os.OperatingSystem.current().isMacOsX) {
|
|
|
|
|
add("kspIosSimulatorArm64", libs.androidx.room3.compiler)
|
|
|
|
|
// add("kspIosX64", libs.androidx.room.compiler)
|
|
|
|
|
add("kspIosArm64", libs.androidx.room3.compiler)
|
|
|
|
|
}
|
2026-06-16 20:28:05 +03:00
|
|
|
// add("kspJvm", libs.androidx.room3.compiler)
|
2026-03-24 04:47:19 +02:00
|
|
|
// Add any other platform target you use in your project, for example kspDesktop
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-02 00:05:38 +02:00
|
|
|
room3 {
|
2026-03-24 04:47:19 +02:00
|
|
|
schemaDirectory("$projectDir/schemas")
|
2026-03-23 01:41:39 +02:00
|
|
|
}
|
|
|
|
|
|
2026-06-15 14:39:46 +02:00
|
|
|
sqldelight {
|
|
|
|
|
databases {
|
|
|
|
|
create("ChannelsDatabase") {
|
|
|
|
|
packageName.set("fr.acinq.phoenix.db.sqldelight")
|
|
|
|
|
srcDirs.from("src/commonMain/sqldelight/channelsdb")
|
|
|
|
|
}
|
|
|
|
|
create("PaymentsDatabase") {
|
|
|
|
|
packageName.set("fr.acinq.phoenix.db.sqldelight")
|
|
|
|
|
srcDirs.from("src/commonMain/sqldelight/paymentsdb")
|
|
|
|
|
}
|
|
|
|
|
create("AppDatabase") {
|
|
|
|
|
packageName.set("fr.acinq.phoenix.db.sqldelight")
|
|
|
|
|
srcDirs.from("src/commonMain/sqldelight/appdb")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-23 01:41:39 +02:00
|
|
|
compose.desktop {
|
|
|
|
|
application {
|
2026-07-15 01:14:46 +02:00
|
|
|
mainClass = "press.mantra.desktop.MainKt"
|
2026-03-23 01:41:39 +02:00
|
|
|
|
|
|
|
|
nativeDistributions {
|
|
|
|
|
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
|
2026-07-15 01:14:46 +02:00
|
|
|
packageName = "press.mantra.desktop"
|
2026-03-23 01:41:39 +02:00
|
|
|
packageVersion = "1.0.0"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|