From 3e8d44d973d069e01a8fb838fc0eafcb4549c4c6 Mon Sep 17 00:00:00 2001 From: Daniel Lindenkreuz Date: Wed, 12 Jun 2019 15:36:04 +0200 Subject: [PATCH] fix: swift package compatibility --- Package.swift | 12 +++++++++--- Sources/iOS/IndexPathConverter.swift | 2 ++ Sources/iOS/UICollectionView+Extensions.swift | 3 ++- Sources/iOS/UITableView+Extensions.swift | 2 ++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Package.swift b/Package.swift index 0f6991d..50dd3b9 100644 --- a/Package.swift +++ b/Package.swift @@ -1,13 +1,19 @@ -// swift-tools-version:5.1 +// swift-tools-version:5.0 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "DeepDiff", + platforms: [ + .macOS(.v10_11), + .iOS(.v8), + .tvOS(.v11), + .watchOS(.v3) + ], products: [ - .library(name: "DeepDiff", targets: ["DeepDiff"]) + .library(name: "DeepDiff", targets: ["DeepDiff"]), ], targets: [ - .target( name: "DeepDiff", dependencies: []) + .target(name: "DeepDiff", path: "Sources") ] ) diff --git a/Sources/iOS/IndexPathConverter.swift b/Sources/iOS/IndexPathConverter.swift index a2b7e14..b6dfdb2 100755 --- a/Sources/iOS/IndexPathConverter.swift +++ b/Sources/iOS/IndexPathConverter.swift @@ -6,6 +6,7 @@ // Copyright © 2018 Khoa Pham. All rights reserved. // +#if os(iOS) || os(tvOS) import Foundation public struct ChangeWithIndexPath { @@ -58,3 +59,4 @@ extension Int { return IndexPath(item: self, section: section) } } +#endif diff --git a/Sources/iOS/UICollectionView+Extensions.swift b/Sources/iOS/UICollectionView+Extensions.swift index 4828bec..08285a9 100755 --- a/Sources/iOS/UICollectionView+Extensions.swift +++ b/Sources/iOS/UICollectionView+Extensions.swift @@ -6,6 +6,7 @@ // Copyright © 2018 Khoa Pham. All rights reserved. // +#if os(iOS) || os(tvOS) import UIKit public extension UICollectionView { @@ -60,4 +61,4 @@ public extension UICollectionView { } } } - +#endif diff --git a/Sources/iOS/UITableView+Extensions.swift b/Sources/iOS/UITableView+Extensions.swift index fb6d698..ce73ec8 100755 --- a/Sources/iOS/UITableView+Extensions.swift +++ b/Sources/iOS/UITableView+Extensions.swift @@ -6,6 +6,7 @@ // Copyright © 2018 Khoa Pham. All rights reserved. // +#if os(iOS) || os(tvOS) import UIKit public extension UITableView { @@ -91,3 +92,4 @@ public extension UITableView { } } } +#endif