saoudrizwan / Disk

Delightful framework for iOS to easily persist structs, images, and data
MIT License
3.08k stars 170 forks source link

Installing as dependency in Swift Package Manager doesn't work #43

Closed freshtechs closed 5 years ago

freshtechs commented 6 years ago

I first created an empty Xcode Project with swift init Then edited the Package.swift to include the Disk Dependency and Disk target After that run on Root Folder of project from terminal swift package generate-xcodeproj Then swift build throws this errors:

Compile Swift Module 'Disk' (10 sources) /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:33:31: error: use of undeclared type 'UIImage' static func save(_ value: UIImage, to directory: Directory, as path: String) throws { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:33:32: error: use of undeclared type 'UIImage' static func save(_ value: [UIImage], to directory: Directory, as path: String) throws { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:88:102: error: use of undeclared type 'UIImage' static func retrieve(_ path: String, from directory: Directory, as type: UIImage.Type) throws -> UIImage { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:88:78: error: use of undeclared type 'UIImage' static func retrieve(_ path: String, from directory: Directory, as type: UIImage.Type) throws -> UIImage { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:141:105: error: use of undeclared type 'UIImage' static func retrieve(_ path: String, from directory: Directory, as type: [UIImage].Type) throws -> [UIImage] { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:141:79: error: use of undeclared type 'UIImage' static func retrieve(_ path: String, from directory: Directory, as type: [UIImage].Type) throws -> [UIImage] { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:33:31: error: use of undeclared type 'UIImage' static func save(_ value: UIImage, to directory: Directory, as path: String) throws { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:33:32: error: use of undeclared type 'UIImage' static func save(_ value: [UIImage], to directory: Directory, as path: String) throws { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:71:33: error: use of undeclared type 'UIImage' static func append(_ value: UIImage, to path: String, in directory: Directory) throws { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:119:34: error: use of undeclared type 'UIImage' static func append(_ value: [UIImage], to path: String, in directory: Directory) throws { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:88:102: error: use of undeclared type 'UIImage' static func retrieve(_ path: String, from directory: Directory, as type: UIImage.Type) throws -> UIImage { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:88:78: error: use of undeclared type 'UIImage' static func retrieve(_ path: String, from directory: Directory, as type: UIImage.Type) throws -> UIImage { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:141:105: error: use of undeclared type 'UIImage' static func retrieve(_ path: String, from directory: Directory, as type: [UIImage].Type) throws -> [UIImage] { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:141:79: error: use of undeclared type 'UIImage' static func retrieve(_ path: String, from directory: Directory, as type: [UIImage].Type) throws -> [UIImage] { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+VolumeInformation.swift:60:64: error: 'volumeAvailableCapacityForImportantUsageKey' is only available on OS X 10.13 or newer let resourceValues = getVolumeResourceValues(for: .volumeAvailableCapacityForImportantUsageKey) ^ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+VolumeInformation.swift:60:64: note: add 'if #available' version check let resourceValues = getVolumeResourceValues(for: .volumeAvailableCapacityForImportantUsageKey) ^ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+VolumeInformation.swift:58:23: note: add @available attribute to enclosing static var public static var availableCapacityForImportantUsage: Int? { ^ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+VolumeInformation.swift:30:8: note: add @available attribute to enclosing extension public extension Disk { ^ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+VolumeInformation.swift:61:45: error: 'volumeAvailableCapacityForImportantUsage' is only available on OS X 10.13 or newer if let result = resourceValues?.volumeAvailableCapacityForImportantUsage { ^ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+VolumeInformation.swift:61:45: note: add 'if #available' version check if let result = resourceValues?.volumeAvailableCapacityForImportantUsage { ^ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+VolumeInformation.swift:58:23: note: add @available attribute to enclosing static var public static var availableCapacityForImportantUsage: Int? { ^ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+VolumeInformation.swift:30:8: note: add @available attribute to enclosing extension public extension Disk { ^ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+VolumeInformation.swift:75:64: error: 'volumeAvailableCapacityForOpportunisticUsageKey' is only available on OS X 10.13 or newer let resourceValues = getVolumeResourceValues(for: .volumeAvailableCapacityForOpportunisticUsageKey) ^ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+VolumeInformation.swift:75:64: note: add 'if #available' version check let resourceValues = getVolumeResourceValues(for: .volumeAvailableCapacityForOpportunisticUsageKey) ^ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+VolumeInformation.swift:73:23: note: add @available attribute to enclosing static var public static var availableCapacityForOpportunisticUsage: Int? { ^ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+VolumeInformation.swift:30:8: note: add @available attribute to enclosing extension public extension Disk { ^ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+VolumeInformation.swift:76:45: error: 'volumeAvailableCapacityForOpportunisticUsage' is only available on OS X 10.13 or newer if let result = resourceValues?.volumeAvailableCapacityForOpportunisticUsage { ^ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+VolumeInformation.swift:76:45: note: add 'if #available' version check if let result = resourceValues?.volumeAvailableCapacityForOpportunisticUsage { ^ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+VolumeInformation.swift:73:23: note: add @available attribute to enclosing static var public static var availableCapacityForOpportunisticUsage: Int? { ^ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+VolumeInformation.swift:30:8: note: add @available attribute to enclosing extension public extension Disk { ^ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:33:31: error: use of undeclared type 'UIImage' static func save(_ value: UIImage, to directory: Directory, as path: String) throws { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:33:32: error: use of undeclared type 'UIImage' static func save(_ value: [UIImage], to directory: Directory, as path: String) throws { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:71:33: error: use of undeclared type 'UIImage' static func append(_ value: UIImage, to path: String, in directory: Directory) throws { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:119:34: error: use of undeclared type 'UIImage' static func append(_ value: [UIImage], to path: String, in directory: Directory) throws { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:88:102: error: use of undeclared type 'UIImage' static func retrieve(_ path: String, from directory: Directory, as type: UIImage.Type) throws -> UIImage { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:88:78: error: use of undeclared type 'UIImage' static func retrieve(_ path: String, from directory: Directory, as type: UIImage.Type) throws -> UIImage { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:141:105: error: use of undeclared type 'UIImage' static func retrieve(_ path: String, from directory: Directory, as type: [UIImage].Type) throws -> [UIImage] { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:141:79: error: use of undeclared type 'UIImage' static func retrieve(_ path: String, from directory: Directory, as type: [UIImage].Type) throws -> [UIImage] { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:33:31: error: use of undeclared type 'UIImage' static func save(_ value: UIImage, to directory: Directory, as path: String) throws { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:88:102: error: use of undeclared type 'UIImage' static func retrieve(_ path: String, from directory: Directory, as type: UIImage.Type) throws -> UIImage { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:88:78: error: use of undeclared type 'UIImage' static func retrieve(_ path: String, from directory: Directory, as type: UIImage.Type) throws -> UIImage { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:33:32: error: use of undeclared type 'UIImage' static func save(_ value: [UIImage], to directory: Directory, as path: String) throws { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:71:33: error: use of undeclared type 'UIImage' static func append(_ value: UIImage, to path: String, in directory: Directory) throws { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:119:34: error: use of undeclared type 'UIImage' static func append(_ value: [UIImage], to path: String, in directory: Directory) throws { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:141:105: error: use of undeclared type 'UIImage' static func retrieve(_ path: String, from directory: Directory, as type: [UIImage].Type) throws -> [UIImage] { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+[UIImage].swift:141:79: error: use of undeclared type 'UIImage' static func retrieve(_ path: String, from directory: Directory, as type: [UIImage].Type) throws -> [UIImage] { ^~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:37:31: error: use of unresolved identifier 'UIImagePNGRepresentation' if let data = UIImagePNGRepresentation(value) { ^~~~~~~~~~~~~~~~~~~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:48:31: error: use of unresolved identifier 'UIImageJPEGRepresentation' if let data = UIImageJPEGRepresentation(value, 1) { ^~~~~~~~~~~~~~~~~~~~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:59:31: error: use of unresolved identifier 'UIImagePNGRepresentation' if let data = UIImagePNGRepresentation(value) { ^~~~~~~~~~~~~~~~~~~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:61:38: error: use of unresolved identifier 'UIImageJPEGRepresentation' } else if let data = UIImageJPEGRepresentation(value, 1) { ^~~~~~~~~~~~~~~~~~~~~~~~~ /Users/fran/Desktop/TestApp/.build/checkouts/Disk.git-5746674856174794633/Sources/Disk+UIImage.swift:92:28: error: use of unresolved identifier 'UIImage'; did you mean 'CGImage'? if let image = UIImage(data: data) { ^~~~~~~ CGImage CoreGraphics.CGImage:1:14: note: 'CGImage' declared here public class CGImage : _CFObject { ^ error: terminated(1): /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/fran/Desktop/TestApp/.build/debug.yaml main output:

wess commented 6 years ago

Is this lib only meant to be used for iOS?

saoudrizwan commented 5 years ago

@wess Yes this library is meant for iOS use. I just updated Disk to work with the new Xcode, try using SPM now.