Skip to content

Commit 6995e8a

Browse files
committed
Support watchOS, local SDK override
1 parent 723bcbe commit 6995e8a

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

Package.swift

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ let packageName = "PowerSync"
88
// build. Also see docs/LocalBuild.md for details
99
let localKotlinSdkOverride: String? = nil
1010

11+
// Set this to the absolute path of your powersync-sqlite-core checkout if you want to use a
12+
// local build of the core extension.
13+
let localCoreExtension: String? = nil
14+
1115
// Our target and dependency setup is different when a local Kotlin SDK is used. Without the local
1216
// SDK, we have no package dependency on Kotlin and download the XCFramework from Kotlin releases as
1317
// a binary target.
@@ -32,29 +36,40 @@ if let kotlinSdkPath = localKotlinSdkOverride {
3236
))
3337
}
3438

39+
var corePackageName = "powersync-sqlite-core-swift"
40+
if let corePath = localCoreExtension {
41+
conditionalDependencies.append(.package(path: corePath))
42+
corePackageName = "powersync-sqlite-core"
43+
} else {
44+
// Not using a local build, so download from releases
45+
conditionalDependencies.append(.package(
46+
url: "https://github.com/powersync-ja/powersync-sqlite-core-swift.git",
47+
exact: "0.4.0"
48+
))
49+
}
50+
3551
let package = Package(
3652
name: packageName,
3753
platforms: [
3854
.iOS(.v13),
39-
.macOS(.v10_15)
55+
.macOS(.v10_15),
56+
.watchOS(.v9)
4057
],
4158
products: [
4259
// Products define the executables and libraries a package produces, making them visible to other packages.
4360
.library(
4461
name: packageName,
4562
targets: ["PowerSync"]),
4663
],
47-
dependencies: [
48-
.package(url: "https://github.com/powersync-ja/powersync-sqlite-core-swift.git", exact: "0.4.0")
49-
] + conditionalDependencies,
64+
dependencies: conditionalDependencies,
5065
targets: [
5166
// Targets are the basic building blocks of a package, defining a module or a test suite.
5267
// Targets can depend on other targets in this package and products from dependencies.
5368
.target(
5469
name: packageName,
5570
dependencies: [
5671
kotlinTargetDependency,
57-
.product(name: "PowerSyncSQLiteCore", package: "powersync-sqlite-core-swift")
72+
.product(name: "PowerSyncSQLiteCore", package: corePackageName)
5873
]),
5974
.testTarget(
6075
name: "PowerSyncTests",

0 commit comments

Comments
 (0)