From a8a3a4a87c074a24e77ca2d8dd3beffb6ad11665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A5le=20Stor=C3=B8=20Hauknes?= <270292+LaStrada@users.noreply.github.com> Date: Fri, 26 Jun 2026 13:57:53 +0200 Subject: [PATCH 1/3] Add macOS targets (macosX64 + macosArm64) and a Swift package Add macOS Kotlin/Native targets and include macOS in the KMMBridge xcframework (min macOS 11). Move the shared Apple platform implementations (PlatformFileInputOutput, PlatformPrinterLoggerFacility) from iosMain to appleMain so they serve both iOS and macOS. Add Package.swift exposing the xcframework as a Swift package. --- Package.swift | 25 +++++++++++++++++++ build.gradle.kts | 3 +++ .../platform/PlatformFileInputOutputImpl.kt | 0 .../PlatformPrinterLoggerFacilityImpl.kt | 0 4 files changed, 28 insertions(+) create mode 100644 Package.swift rename src/{iosMain => appleMain}/kotlin/com/airthings/lib/logging/platform/PlatformFileInputOutputImpl.kt (100%) rename src/{iosMain => appleMain}/kotlin/com/airthings/lib/logging/platform/PlatformPrinterLoggerFacilityImpl.kt (100%) diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..22c53cd --- /dev/null +++ b/Package.swift @@ -0,0 +1,25 @@ +// swift-tools-version:5.9 +import PackageDescription + +let packageName = "KmpLog" + +let package = Package( + name: packageName, + platforms: [ + .iOS(.v14), +.macOS(.v11) + ], + products: [ + .library( + name: packageName, + targets: [packageName] + ), + ], + targets: [ + .binaryTarget( + name: packageName, + path: "./build/XCFrameworks/debug/\(packageName).xcframework" + ) + , + ] +) \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 2e14991..5aac46c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -103,6 +103,8 @@ kotlin { iosX64(), iosArm64(), iosSimulatorArm64(), + macosX64(), + macosArm64(), ).forEach { // Fixes this: https://rdr.to/DkdMx1MXyeB it.binaries.all { @@ -188,6 +190,7 @@ kmmbridge { swiftToolVersion = "5.9", targetPlatforms = { iOS { v("14") } + macOS { v("11") } }, ) } diff --git a/src/iosMain/kotlin/com/airthings/lib/logging/platform/PlatformFileInputOutputImpl.kt b/src/appleMain/kotlin/com/airthings/lib/logging/platform/PlatformFileInputOutputImpl.kt similarity index 100% rename from src/iosMain/kotlin/com/airthings/lib/logging/platform/PlatformFileInputOutputImpl.kt rename to src/appleMain/kotlin/com/airthings/lib/logging/platform/PlatformFileInputOutputImpl.kt diff --git a/src/iosMain/kotlin/com/airthings/lib/logging/platform/PlatformPrinterLoggerFacilityImpl.kt b/src/appleMain/kotlin/com/airthings/lib/logging/platform/PlatformPrinterLoggerFacilityImpl.kt similarity index 100% rename from src/iosMain/kotlin/com/airthings/lib/logging/platform/PlatformPrinterLoggerFacilityImpl.kt rename to src/appleMain/kotlin/com/airthings/lib/logging/platform/PlatformPrinterLoggerFacilityImpl.kt From 5869689183f8bb49a0364ce67fb17cc8884ad005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A5le=20Stor=C3=B8=20Hauknes?= <270292+LaStrada@users.noreply.github.com> Date: Tue, 4 Aug 2026 14:12:08 +0200 Subject: [PATCH 2/3] Stop tracking the generated Package.swift The manifest is generated, not authored. `gradlew spmDevBuild` writes the local-dev variant that points at the debug XCFramework, and the publish job writes the release variant carrying the artifact URL and checksum, commits it, and moves the release tag onto that commit. The default branch has never carried one. The tracked copy was spmDevBuild output that got checked in: deleting it and re-running the task reproduces it byte for byte. Ignore it so a local debug manifest can't reach a release. --- Package.swift | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 Package.swift diff --git a/Package.swift b/Package.swift deleted file mode 100644 index 22c53cd..0000000 --- a/Package.swift +++ /dev/null @@ -1,25 +0,0 @@ -// swift-tools-version:5.9 -import PackageDescription - -let packageName = "KmpLog" - -let package = Package( - name: packageName, - platforms: [ - .iOS(.v14), -.macOS(.v11) - ], - products: [ - .library( - name: packageName, - targets: [packageName] - ), - ], - targets: [ - .binaryTarget( - name: packageName, - path: "./build/XCFrameworks/debug/\(packageName).xcframework" - ) - , - ] -) \ No newline at end of file From ab1ea91eabe92f69101d0e4e294a70a2a72a39bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A5le=20Stor=C3=B8=20Hauknes?= <270292+LaStrada@users.noreply.github.com> Date: Tue, 4 Aug 2026 14:12:55 +0200 Subject: [PATCH 3/3] Ignore the generated Package.swift Without this, running the spmDevBuild task leaves an untracked manifest in the working tree that can be committed again by accident. --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index f6983e0..de70b9a 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ local.properties !.idea/runConfigurations/ .kotlin + +# Generated by KMMBridge — `gradlew spmDevBuild` locally, written by the publish job for releases. +Package.swift