-
Notifications
You must be signed in to change notification settings - Fork 39
/
Package.swift
86 lines (77 loc) · 1.71 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "imglyKit",
defaultLocalization: .resolved(),
platforms: [
.iOS(.v9), .macOS(.v10_10),
],
products: [
.library(
name: "imglyKit",
targets: ["imglyKit"]
)
],
dependencies: [],
targets: [
.target(
name: "imglyKit",
dependencies: ["imglyKit-ObjC"],
path: "imglyKit",
exclude: Exclude.resolved(),
resources: Resource.resolved()
),
.target(
name: "imglyKit-ObjC",
path: "imglyKit/Backend/Processing/ObjC",
publicHeadersPath: ""
)
]
)
private extension LanguageTag {
static func resolved() -> LanguageTag? {
#if os(iOS)
return .init("en")
#elseif os(macOS)
return nil
#endif
}
}
private enum Exclude {
static func common() -> [String] {
[
"Supporting Files",
"Backend/Processing/ObjC"
]
}
static func platform() -> [String] {
#if os(iOS)
return []
#elseif os(macOS)
return [
"Frontend",
]
#endif
}
static func resolved() -> [String] {
common() + platform()
}
}
private extension Resource {
static func common() -> [Self] {
[
.process("Backend/Filter Responses"),
.process("Backend/Fonts")
]
}
static func platform() -> [Self] {
#if os(iOS)
return []
#elseif os(macOS)
return []
#endif
}
static func resolved() -> [Self] {
common() + platform()
}
}