Skip to content

watchOS support #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -32,29 +36,40 @@ 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.0"
))
}

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.
.library(
name: packageName,
targets: ["PowerSync"]),
],
dependencies: [
.package(url: "https://github.com/powersync-ja/powersync-sqlite-core-swift.git", exact: "0.4.0")
] + 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.
.target(
name: packageName,
dependencies: [
kotlinTargetDependency,
.product(name: "PowerSyncSQLiteCore", package: "powersync-sqlite-core-swift")
.product(name: "PowerSyncSQLiteCore", package: corePackageName)
]),
.testTarget(
name: "PowerSyncTests",
Expand Down