From 2ab37f31307640fb8d3e9d28180e037a30eaacc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Fri, 29 Jan 2021 15:48:35 +0100 Subject: [PATCH 1/3] Add basic SwiftPM support for Objective-C code --- Package.resolved | 16 ++++++++++++++++ Package.swift | 20 ++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 Package.resolved create mode 100644 Package.swift diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000..673b71e --- /dev/null +++ b/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "FMDB", + "repositoryURL": "https://github.com/ccgus/fmdb.git", + "state": { + "branch": null, + "revision": "61e51fde7f7aab6554f30ab061cc588b28a97d04", + "version": "2.7.7" + } + } + ] + }, + "version": 1 +} diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..9905f40 --- /dev/null +++ b/Package.swift @@ -0,0 +1,20 @@ +// swift-tools-version:5.3 +import PackageDescription + +let package = Package( + name: "FCModel", + platforms: [.macOS(.v10_10), .iOS(.v9)], + products: [.library(name: "FCModel", targets: ["FCModel"])], + dependencies: [ + .package(name: "FMDB", url: "https://github.com/ccgus/fmdb.git", from: "2.7.7"), + ], + targets: [ + .target( + name: "FCModel", + dependencies: ["FMDB"], + path: "FCModel", + exclude: ["FCModel+ObservableObject.swift"], + publicHeadersPath: "include" + ) + ] +) From 5a1013a659a3d0ab9bf717acbe379d428abedf8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Tue, 2 Feb 2021 08:58:07 +0100 Subject: [PATCH 2/3] Change public header path --- .../xcode/package.xcworkspace/contents.xcworkspacedata | 7 +++++++ Package.swift | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Package.swift b/Package.swift index 9905f40..89ca757 100644 --- a/Package.swift +++ b/Package.swift @@ -14,7 +14,7 @@ let package = Package( dependencies: ["FMDB"], path: "FCModel", exclude: ["FCModel+ObservableObject.swift"], - publicHeadersPath: "include" + publicHeadersPath: "FCModel" ) ] ) From 5a6c90fd63ef0fe64caed675a0e0fbd56e608fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Tue, 2 Feb 2021 09:13:18 +0100 Subject: [PATCH 3/3] Fix SwiftPM support via moving public headers to separate folder --- FCModel/{ => Sources}/FCModel.m | 0 FCModel/{ => Sources}/FCModelCachedObject.m | 0 FCModel/{ => Sources}/FCModelDatabase.m | 0 FCModel/{ => Sources}/FCModelNotificationCenter.m | 0 FCModel/{ => include}/FCModel.h | 0 FCModel/{ => include}/FCModelCachedObject.h | 0 FCModel/{ => include}/FCModelDatabase.h | 0 FCModel/{ => include}/FCModelNotificationCenter.h | 0 Package.swift | 3 +-- 9 files changed, 1 insertion(+), 2 deletions(-) rename FCModel/{ => Sources}/FCModel.m (100%) rename FCModel/{ => Sources}/FCModelCachedObject.m (100%) rename FCModel/{ => Sources}/FCModelDatabase.m (100%) rename FCModel/{ => Sources}/FCModelNotificationCenter.m (100%) rename FCModel/{ => include}/FCModel.h (100%) rename FCModel/{ => include}/FCModelCachedObject.h (100%) rename FCModel/{ => include}/FCModelDatabase.h (100%) rename FCModel/{ => include}/FCModelNotificationCenter.h (100%) diff --git a/FCModel/FCModel.m b/FCModel/Sources/FCModel.m similarity index 100% rename from FCModel/FCModel.m rename to FCModel/Sources/FCModel.m diff --git a/FCModel/FCModelCachedObject.m b/FCModel/Sources/FCModelCachedObject.m similarity index 100% rename from FCModel/FCModelCachedObject.m rename to FCModel/Sources/FCModelCachedObject.m diff --git a/FCModel/FCModelDatabase.m b/FCModel/Sources/FCModelDatabase.m similarity index 100% rename from FCModel/FCModelDatabase.m rename to FCModel/Sources/FCModelDatabase.m diff --git a/FCModel/FCModelNotificationCenter.m b/FCModel/Sources/FCModelNotificationCenter.m similarity index 100% rename from FCModel/FCModelNotificationCenter.m rename to FCModel/Sources/FCModelNotificationCenter.m diff --git a/FCModel/FCModel.h b/FCModel/include/FCModel.h similarity index 100% rename from FCModel/FCModel.h rename to FCModel/include/FCModel.h diff --git a/FCModel/FCModelCachedObject.h b/FCModel/include/FCModelCachedObject.h similarity index 100% rename from FCModel/FCModelCachedObject.h rename to FCModel/include/FCModelCachedObject.h diff --git a/FCModel/FCModelDatabase.h b/FCModel/include/FCModelDatabase.h similarity index 100% rename from FCModel/FCModelDatabase.h rename to FCModel/include/FCModelDatabase.h diff --git a/FCModel/FCModelNotificationCenter.h b/FCModel/include/FCModelNotificationCenter.h similarity index 100% rename from FCModel/FCModelNotificationCenter.h rename to FCModel/include/FCModelNotificationCenter.h diff --git a/Package.swift b/Package.swift index 89ca757..ee3905e 100644 --- a/Package.swift +++ b/Package.swift @@ -13,8 +13,7 @@ let package = Package( name: "FCModel", dependencies: ["FMDB"], path: "FCModel", - exclude: ["FCModel+ObservableObject.swift"], - publicHeadersPath: "FCModel" + exclude: ["FCModel+ObservableObject.swift"] ) ] )