@@ -8,6 +8,10 @@ let packageName = "PowerSync"
8
8
// build. Also see docs/LocalBuild.md for details
9
9
let localKotlinSdkOverride : String ? = nil
10
10
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
+
11
15
// Our target and dependency setup is different when a local Kotlin SDK is used. Without the local
12
16
// SDK, we have no package dependency on Kotlin and download the XCFramework from Kotlin releases as
13
17
// a binary target.
@@ -32,29 +36,40 @@ if let kotlinSdkPath = localKotlinSdkOverride {
32
36
) )
33
37
}
34
38
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
+
35
51
let package = Package (
36
52
name: packageName,
37
53
platforms: [
38
54
. iOS( . v13) ,
39
- . macOS( . v10_15)
55
+ . macOS( . v10_15) ,
56
+ . watchOS( . v9)
40
57
] ,
41
58
products: [
42
59
// Products define the executables and libraries a package produces, making them visible to other packages.
43
60
. library(
44
61
name: packageName,
45
62
targets: [ " PowerSync " ] ) ,
46
63
] ,
47
- dependencies: [
48
- . package ( url: " https://github.com/powersync-ja/powersync-sqlite-core-swift.git " , exact: " 0.4.0 " )
49
- ] + conditionalDependencies,
64
+ dependencies: conditionalDependencies,
50
65
targets: [
51
66
// Targets are the basic building blocks of a package, defining a module or a test suite.
52
67
// Targets can depend on other targets in this package and products from dependencies.
53
68
. target(
54
69
name: packageName,
55
70
dependencies: [
56
71
kotlinTargetDependency,
57
- . product( name: " PowerSyncSQLiteCore " , package : " powersync-sqlite-core-swift " )
72
+ . product( name: " PowerSyncSQLiteCore " , package : corePackageName )
58
73
] ) ,
59
74
. testTarget(
60
75
name: " PowerSyncTests " ,
0 commit comments