-
Notifications
You must be signed in to change notification settings - Fork 65
/
Package.swift
100 lines (91 loc) · 2.42 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// swift-tools-version: 5.9
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on
// https://github.com/algolia/api-clients-automation. DO NOT EDIT.
import PackageDescription
var extraPackageDependencies: [Package.Dependency] = []
var extraTargetDependencies: [Target.Dependency] = []
var targets: [Target] = []
var products: [Product] = []
#if os(Linux)
let macOSVersion: SupportedPlatform.MacOSVersion = .v10_15
#else
let macOSVersion: SupportedPlatform.MacOSVersion = .v11
#endif
#if os(Linux)
extraPackageDependencies.append(contentsOf: [
.package(url: "https://github.com/apple/swift-crypto.git", from: "3.2.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.4"),
])
extraTargetDependencies.append(contentsOf: [
.product(name: "Crypto", package: "swift-crypto"),
.product(name: "Logging", package: "swift-log"),
])
#endif
#if os(Linux)
targets.append(contentsOf: [
.systemLibrary(name: "zlib", pkgConfig: "zlib", providers: [.apt(["zlib1g-dev"])]),
.target(
name: "Core",
dependencies: [
"zlib",
] + extraTargetDependencies,
path: "Sources/Core"
),
])
#else
targets.append(
.target(
name: "Core",
dependencies: extraTargetDependencies,
path: "Sources/Core"
)
)
#endif
products.append(
.library(
name: "Core",
targets: ["Core"]
)
)
[
"Abtesting",
"Analytics",
"Ingestion",
"Insights",
"Monitoring",
"Personalization",
"QuerySuggestions",
"Recommend",
"Search",
].enumerated().forEach { _, library in
targets.append(
.target(
name: library,
dependencies: [
.target(name: "Core"),
] + extraTargetDependencies,
path: "Sources/\(library)",
resources: [
.copy("../../PrivacyInfo.xcprivacy"),
]
)
)
products.append(
.library(
name: "\(library)",
targets: ["\(library)"]
)
)
}
let package = Package(
name: "AlgoliaSearchClient",
platforms: [
.iOS(.v14),
.macOS(macOSVersion),
.tvOS(.v14),
.watchOS(.v7),
],
products: products,
dependencies: extraPackageDependencies,
targets: targets
)