diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index d3a2975d..bb8eed65 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -25,13 +25,21 @@ kotlin { } } - listOf( - iosArm64(), - iosSimulatorArm64() - ).forEach { iosTarget -> - iosTarget.binaries.framework { - baseName = "ComposeApp" - isStatic = true + // 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 + } } } @@ -119,8 +127,12 @@ kotlin { implementation(compose.desktop.currentOs) implementation(libs.kotlinx.coroutinesSwing) } - iosMain.dependencies { - implementation(libs.sqldelight.native.driver) + // 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) + } } } } @@ -164,9 +176,13 @@ dependencies { debugImplementation(libs.compose.uiTooling) // ksp(libs.androidx.room3.compiler) add("kspAndroid", libs.androidx.room3.compiler) - add("kspIosSimulatorArm64", libs.androidx.room3.compiler) -// add("kspIosX64", libs.androidx.room.compiler) - add("kspIosArm64", libs.androidx.room3.compiler) + // 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) + } // add("kspJvm", libs.androidx.room3.compiler) // Add any other platform target you use in your project, for example kspDesktop } diff --git a/gradle.properties b/gradle.properties index 9550c009..8d436de2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,13 @@ kotlin.daemon.jvmargs=-Xmx12g #Gradle org.gradle.jvmargs=-Xmx8g -Dfile.encoding=UTF-8 -org.gradle.configuration-cache=true +# Off because the lightning-kmp-app composite build reaches, through its experimental/lightning-kmp +# -> bitcoin-kmp -> secp256k1-kmp submodule chain, two tasks that cannot be serialized: +# secp256k1-kmp's `:jni:generateHeaders` and `:native:buildSecp256k1` both hold gradle +# script object references. The configuration cache covers a whole build tree, so an included +# build's incompatibility is this build's problem -- there is no per-build opt-out. Re-enable once +# those two tasks are fixed upstream in the secp256k1-kmp fork, or if that includeBuild goes. +org.gradle.configuration-cache=false org.gradle.caching=true #Android diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37f78a6a..c42672d9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/lightning-kmp-app b/lightning-kmp-app index 6745d881..bbba08b1 160000 --- a/lightning-kmp-app +++ b/lightning-kmp-app @@ -1 +1 @@ -Subproject commit 6745d881d858b50f2e7108e59323c7e18a14dbcc +Subproject commit bbba08b1224631d23768b6f5b044eca2f77518b6 diff --git a/secp256k1-frost-kmp b/secp256k1-frost-kmp index e67fe177..d3b294d4 160000 --- a/secp256k1-frost-kmp +++ b/secp256k1-frost-kmp @@ -1 +1 @@ -Subproject commit e67fe177e4873dc2af8a07a57df6c85e02305a7c +Subproject commit d3b294d4c5aab519bc91c2e2008dea223ae8b5cf