Skip to content

Commit 6eeb930

Browse files
committed
Build with SwiftPM
1 parent c72f07d commit 6eeb930

14 files changed

+190
-82
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ Pods
3131

3232
# Carthage
3333
Carthage
34+
/.build

Cartfile

-1
This file was deleted.

Cartfile.resolved

-1
This file was deleted.

Imaginary.xcodeproj/project.pbxproj

+135-79
Large diffs are not rendered by default.

Imaginary.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"object": {
3+
"pins": [
4+
{
5+
"package": "Cache",
6+
"repositoryURL": "https://github.com/fassko/Cache.git",
7+
"state": {
8+
"branch": "master",
9+
"revision": "9e4ec388aada963cb6c3ce68fcac6abdcadd4320",
10+
"version": null
11+
}
12+
}
13+
]
14+
},
15+
"version": 1
16+
}

Package.swift

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// swift-tools-version:5.1
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "Imaginary",
7+
products: [
8+
.library(
9+
name: "Imaginary",
10+
targets: ["Imaginary"]),
11+
],
12+
dependencies: [
13+
.package(path: "/Users/kristaps/Documents/open-source/Cache")
14+
],
15+
targets: [
16+
.target(
17+
name: "Imaginary",
18+
dependencies: ["Cache"],
19+
path: "Sources"
20+
)
21+
],
22+
swiftLanguageVersions: [.v5]
23+
)

Sources/Mac/Decompressor.swift Sources/Mac/DecompressorCocoa.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if canImport(Cocoa)
12
import Cocoa
23

34
final class Decompressor {
@@ -47,3 +48,4 @@ final class Decompressor {
4748
return blendedImage
4849
}
4950
}
51+
#endif

Sources/Mac/ImageViewDisplayer.swift Sources/Mac/ImageViewDisplayerCocoa.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if canImport(AppKit)
12
import AppKit
23

34
/// Used to set image onto ImageView
@@ -45,3 +46,4 @@ fileprivate extension NSImage {
4546
return maskRef
4647
}
4748
}
49+
#endif

Sources/iOS/ButtonBackgroundDisplayer.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if canImport(UIKit)
12
import UIKit
23

34
/// Used to set background image onto Button
@@ -24,3 +25,4 @@ public class ButtonBackgroundDisplayer: ImageDisplayer {
2425
}, completion: nil)
2526
}
2627
}
28+
#endif

Sources/iOS/ButtonDisplayer.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if canImport(UIKit)
12
import UIKit
23

34
/// Used to set image onto Button
@@ -24,3 +25,4 @@ public class ButtonDisplayer: ImageDisplayer {
2425
}, completion: nil)
2526
}
2627
}
28+
#endif

Sources/iOS/Decompressor.swift Sources/iOS/DecompressorUIKit.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if canImport(UIKit)
12
import UIKit
23

34
final class Decompressor {
@@ -37,3 +38,4 @@ final class Decompressor {
3738
return Image(cgImage: imageRefWithoutAlpha)
3839
}
3940
}
41+
#endif

Sources/iOS/ImageViewDisplayer.swift Sources/iOS/ImageViewDisplayerUIKit.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if canImport(UIKit)
12
import UIKit
23

34
/// Used to set image onto ImageView
@@ -29,3 +30,4 @@ public class ImageViewDisplayer: ImageDisplayer {
2930
}, completion: nil)
3031
}
3132
}
33+
#endif

Sources/iOS/TintImageProcessor.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if canImport(UIKit)
12
import UIKit
23

34
/// Apply tint color to image
@@ -55,3 +56,4 @@ public class TintImageProcessor: ImageProcessor {
5556
context.draw(cgImage, in: rect)
5657
}
5758
}
59+
#endif

0 commit comments

Comments
 (0)