diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..da04b443 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "secp256k1-frost-kmp"] + path = secp256k1-frost-kmp + url = https://github.com/ac-cord-ac/secp256k1-frost-kmp.git +[submodule "lightning-kmp-app"] + path = lightning-kmp-app + url = https://github.com/kngako/lightning-kmp-app.git diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index 335ed72d..d3a2975d 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -1,6 +1,5 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat import org.jetbrains.kotlin.gradle.dsl.JvmTarget -import javax.inject.Inject plugins { alias(libs.plugins.androidApplication) @@ -89,8 +88,10 @@ kotlin { - implementation(libs.lightning.kmp.app) - implementation(libs.lightning.kmp.core) +// 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") implementation(libs.navigation.compose) @@ -105,6 +106,9 @@ kotlin { implementation("com.ionspin.kotlin:bignum:0.3.10") + // resolved via the secp256k1-frost-kmp composite build (see settings.gradle.kts) + implementation("ac.cord.auxiliary:library:1.0.0") + implementation("no.synth:kmp-zip:0.8.0") implementation("no.synth:kmp-zip-okio:0.8.0") } @@ -156,37 +160,7 @@ android { } } -// JitPack rewrites the version inside a published .module file, and in doing so drops the classifier -// from every artifact name -- so lightning-kmp-app's apple targets advertise their host-specific -// metadata as `library--.jar` when it is actually served as `...--metadata.jar`. -// The klib and the aar are unaffected (android compiles either way); this only bites the metadata -// compilations, which is what every shared ios source set resolves through. Restore the classifier. -abstract class RestoreJitPackClassifier @Inject constructor( - private val variant: String, -) : ComponentMetadataRule { - override fun execute(context: ComponentMetadataContext) { - val id = context.details.id - context.details.withVariant(variant) { - withFiles { - removeAllFiles() - addFile("${id.name}-${id.version}-metadata.jar") - } - } - } -} - dependencies { - components { - mapOf( - "library-iosarm64" to "iosArm64MetadataElements-published", - "library-iossimulatorarm64" to "iosSimulatorArm64MetadataElements-published", - ).forEach { (module, variant) -> - withModule("com.github.kngako.lightning-kmp-app:$module") { - params(variant) - } - } - } - debugImplementation(libs.compose.uiTooling) // ksp(libs.androidx.room3.compiler) add("kspAndroid", libs.androidx.room3.compiler) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5ac4f03f..17b8cb8d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -21,10 +21,6 @@ kotlinx-datetime = "0.8.0" kotlinxSerialization = "1.11.0" ksp = "2.3.6" ktor = "3.5.2" -# pinned to a commit, not master-SNAPSHOT: jitpack advertises a unique-snapshot maven-metadata for -# -SNAPSHOT versions but serves the files under their literal -SNAPSHOT names, so gradle looks for -# library--master--1.klib and gets a 404. bump this when the fork moves. -lightningKmpApp = "59cc3e3c15" lightningKmpCore = "1.11.5" material3 = "1.10.0-alpha05" materialIconsCore = "1.7.3" @@ -80,7 +76,6 @@ ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" } ktor-client-websockets = { module = "io.ktor:ktor-client-websockets", version.ref = "ktor" } ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" } -lightning-kmp-app = { module = "com.github.kngako.lightning-kmp-app:library", version.ref = "lightningKmpApp" } lightning-kmp-core = { module = "fr.acinq.lightning:lightning-kmp-core", version.ref = "lightningKmpCore" } navigation-compose = { module = "org.jetbrains.androidx.navigation:navigation-compose", version.ref = "navigationCompose" } okhttp-coroutines = { group = "com.squareup.okhttp3", name = "okhttp-coroutines", version.ref = "okhttp" } diff --git a/lightning-kmp-app b/lightning-kmp-app new file mode 160000 index 00000000..6745d881 --- /dev/null +++ b/lightning-kmp-app @@ -0,0 +1 @@ +Subproject commit 6745d881d858b50f2e7108e59323c7e18a14dbcc diff --git a/secp256k1-frost-kmp b/secp256k1-frost-kmp new file mode 160000 index 00000000..24784037 --- /dev/null +++ b/secp256k1-frost-kmp @@ -0,0 +1 @@ +Subproject commit 2478403785b4315f5c6600d5e2712e40a2dea88d diff --git a/settings.gradle.kts b/settings.gradle.kts index 96532c1c..660ac417 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -25,11 +25,6 @@ dependencyResolutionManagement { } } mavenCentral() - maven("https://jitpack.io") { - mavenContent { - includeGroupAndSubgroups("com.github.kngako") - } - } } } @@ -37,4 +32,14 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" } -include(":composeApp") \ No newline at end of file +include(":composeApp") + +// Composite builds: substitute the external module coordinates with the submodules' :library projects. +includeBuild("secp256k1-frost-kmp") +includeBuild("lightning-kmp-app") { + dependencySubstitution { + // the submodule's project stays named :library (compose-resources derives the Res package + // from it); only the coordinate consumers declare is renamed. + substitute(module("fr.acinq.phoenix:lightning-kmp-app")).using(project(":library")) + } +} \ No newline at end of file