From e73c9cf2230b27b016e7019d1934187b32e209a1 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Fri, 13 Jun 2025 12:19:49 +0200 Subject: [PATCH 1/2] Support watchOS, local SDK override --- Package.swift | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/Package.swift b/Package.swift index b066119..e15357a 100644 --- a/Package.swift +++ b/Package.swift @@ -8,6 +8,10 @@ let packageName = "PowerSync" // build. Also see docs/LocalBuild.md for details let localKotlinSdkOverride: String? = nil +// Set this to the absolute path of your powersync-sqlite-core checkout if you want to use a +// local build of the core extension. +let localCoreExtension: String? = nil + // Our target and dependency setup is different when a local Kotlin SDK is used. Without the local // SDK, we have no package dependency on Kotlin and download the XCFramework from Kotlin releases as // a binary target. @@ -32,11 +36,24 @@ if let kotlinSdkPath = localKotlinSdkOverride { )) } +var corePackageName = "powersync-sqlite-core-swift" +if let corePath = localCoreExtension { + conditionalDependencies.append(.package(path: corePath)) + corePackageName = "powersync-sqlite-core" +} else { + // Not using a local build, so download from releases + conditionalDependencies.append(.package( + url: "https://github.com/powersync-ja/powersync-sqlite-core-swift.git", + exact: "0.4.1" + )) +} + let package = Package( name: packageName, platforms: [ .iOS(.v13), - .macOS(.v10_15) + .macOS(.v10_15), + .watchOS(.v9) ], products: [ // Products define the executables and libraries a package produces, making them visible to other packages. @@ -44,9 +61,7 @@ let package = Package( name: packageName, targets: ["PowerSync"]), ], - dependencies: [ - .package(url: "https://github.com/powersync-ja/powersync-sqlite-core-swift.git", exact: "0.4.1") - ] + conditionalDependencies, + dependencies: conditionalDependencies, targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. // Targets can depend on other targets in this package and products from dependencies. @@ -54,7 +69,7 @@ let package = Package( name: packageName, dependencies: [ kotlinTargetDependency, - .product(name: "PowerSyncSQLiteCore", package: "powersync-sqlite-core-swift") + .product(name: "PowerSyncSQLiteCore", package: corePackageName) ]), .testTarget( name: "PowerSyncTests", From c2e97c52e3e548d3284348eedf949996ecfd8614 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Wed, 2 Jul 2025 10:27:39 -0600 Subject: [PATCH 2/2] Test on watchOS --- .github/workflows/build_and_test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index 69dbd39..eb4caa9 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -14,3 +14,4 @@ jobs: run: | xcodebuild test -scheme PowerSync -destination "platform=iOS Simulator,name=iPhone 15" xcodebuild test -scheme PowerSync -destination "platform=macOS,arch=arm64,name=My Mac" + xcodebuild test -scheme PowerSync -destination "platform=watchOS Simulator,arch=arm64"