diff --git a/build.gradle.kts b/build.gradle.kts index 7721bdcdc..3c5fa17c6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -63,7 +63,14 @@ kotlin { } } - // iosSimulatorArm64() : ios simulator on Apple Silicon devices. Disabled for now, until all dependencies support it. + iosSimulatorArm64 { // actual ios devices + compilations["main"].cinterops.create("PhoenixCrypto") { + val platform = "iphonesimulator" + val interopTask = tasks[interopProcessingTaskName] + interopTask.dependsOn(":PhoenixCrypto:buildCrypto${platform.capitalize()}") + includeDirs.headerFilterOnly("$rootDir/PhoenixCrypto/build/Release-$platform/include") + } + } } sourceSets { @@ -88,7 +95,7 @@ kotlin { api(ktor("serialization-kotlinx-json")) implementation(kotlin("test-common")) implementation(kotlin("test-annotations-common")) - implementation("org.kodein.memory:kodein-memory-files:0.8.1") + implementation("org.kodein.memory:klio-files:0.12.0") } } diff --git a/src/commonTest/kotlin/fr/acinq/lightning/serialization/StateSerializationNonRegTestsCommon.kt b/src/commonTest/kotlin/fr/acinq/lightning/serialization/StateSerializationNonRegTestsCommon.kt index 69046eae5..33b657dc2 100644 --- a/src/commonTest/kotlin/fr/acinq/lightning/serialization/StateSerializationNonRegTestsCommon.kt +++ b/src/commonTest/kotlin/fr/acinq/lightning/serialization/StateSerializationNonRegTestsCommon.kt @@ -6,8 +6,8 @@ import fr.acinq.secp256k1.Hex import kotlinx.serialization.encodeToString import org.kodein.memory.file.* import org.kodein.memory.system.Environment -import org.kodein.memory.text.putString import org.kodein.memory.text.readString +import org.kodein.memory.text.writeString import kotlin.test.Test import kotlin.test.assertEquals @@ -29,7 +29,7 @@ class StateSerializationNonRegTestsCommon { val tmpFile = path.resolve("actual.json") if (debug) { tmpFile.openWriteableFile().run { - putString(json) + writeString(json) close() } } diff --git a/src/nativeInterop/cinterop/PhoenixCrypto.def b/src/nativeInterop/cinterop/PhoenixCrypto.def index fbd9042e1..dda3d8f32 100644 --- a/src/nativeInterop/cinterop/PhoenixCrypto.def +++ b/src/nativeInterop/cinterop/PhoenixCrypto.def @@ -7,7 +7,9 @@ headerFilter = PhoenixCrypto/* staticLibraries = libPhoenixCrypto.a libraryPaths.ios_x64 = PhoenixCrypto/build/Release-iphonesimulator libraryPaths.ios_arm64 = PhoenixCrypto/build/Release-iphoneos +libraryPaths.ios_simulator_arm64 = PhoenixCrypto/build/Release-iphonesimulator linkerOpts = -L/usr/lib/swift linkerOpts.ios_x64 = -platform_version ios-simulator 15.0.0 15.0.0 -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/ linkerOpts.ios_arm64 = -iphoneos_version_min 15.0.0 -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/ +linkerOpts.ios_simulator_arm64 = -platform_version ios-simulator 15.0.0 15.0.0 -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/