Skip to content

Commit 1476314

Browse files
committed
Add swiftpm definitions
1 parent 1f8f4a2 commit 1476314

File tree

11 files changed

+69
-58
lines changed

11 files changed

+69
-58
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pubspec_overrides.yaml
99
.flutter-plugins-dependencies
1010
.flutter-plugins
1111
build
12+
.build
1213

1314
# Shared assets
1415
assets/*

packages/powersync_flutter_libs/ios/powersync_flutter_libs.podspec renamed to packages/powersync_flutter_libs/darwin/powersync_flutter_libs.podspec

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@ Pod::Spec.new do |s|
99
s.description = <<-DESC
1010
A new Flutter FFI plugin project.
1111
DESC
12-
s.homepage = 'http://example.com'
12+
s.homepage = 'https://powersync.com'
1313
s.license = { :file => '../LICENSE' }
14-
s.author = { 'Your Company' => 'email@example.com' }
14+
s.author = { 'Journey Mobile, Inc' => 'hello@powersync.com' }
1515

1616
# This will ensure the source files in Classes/ are included in the native
1717
# builds of apps using this FFI plugin. Podspec does not support relative
1818
# paths, so Classes contains a forwarder C file that relatively imports
1919
# `../src/*` so that the C sources can be shared among all target platforms.
2020
s.source = { :path => '.' }
21-
s.source_files = 'Classes/**/*'
22-
s.dependency 'Flutter'
23-
s.platform = :ios, '11.0'
21+
s.source_files = 'powersync_flutter_libs/Sources/powersync_flutter_libs/**/*.swift'
22+
s.ios.dependency 'Flutter'
23+
s.osx.dependency 'FlutterMacOS'
24+
s.ios.deployment_target = '12.0'
25+
s.osx.deployment_target = '10.14'
2426

27+
# NOTE: Always update Package.swift as well when updating this!
2528
s.dependency "powersync-sqlite-core", "~> 0.4.5"
2629

2730
# Flutter.framework does not contain a i386 slice.

packages/powersync_flutter_libs/darwin/powersync_flutter_libs/Package.resolved

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// swift-tools-version: 5.9
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "powersync_flutter_libs",
8+
platforms: [
9+
.iOS("12.0"),
10+
.macOS("10.14")
11+
],
12+
products: [
13+
.library(name: "powersync_flutter_libs", type: .static, targets: ["powersync_flutter_libs"])
14+
],
15+
dependencies: [
16+
.package(
17+
url: "https://github.com/powersync-ja/powersync-sqlite-core-swift.git",
18+
// Note: Always update podspec as well when updating this.
19+
exact: "0.4.5"
20+
)
21+
],
22+
targets: [
23+
.target(
24+
name: "powersync_flutter_libs",
25+
dependencies: ["PowerSyncSQLiteCore"],
26+
resources: []
27+
)
28+
]
29+
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Foundation
2+
3+
#if os(iOS)
4+
import Flutter
5+
#elseif os(macOS)
6+
import FlutterMacOS
7+
#endif
8+
9+
public class PowersyncFlutterLibsPlugin: NSObject, FlutterPlugin {
10+
public static func register(with registrar: FlutterPluginRegistrar) {
11+
// There's no native code, we just want to link the core extension
12+
}
13+
}

packages/powersync_flutter_libs/ios/Classes/PowersyncFlutterLibsPlugin.h

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/powersync_flutter_libs/ios/Classes/PowersyncFlutterLibsPlugin.m

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/powersync_flutter_libs/macos/Classes/PowersyncFlutterLibsPlugin.h

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/powersync_flutter_libs/macos/Classes/PowersyncFlutterLibsPlugin.m

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/powersync_flutter_libs/macos/powersync_flutter_libs.podspec

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)