-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathPackage.swift
More file actions
94 lines (88 loc) · 2.35 KB
/
Package.swift
File metadata and controls
94 lines (88 loc) · 2.35 KB
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
// swift-tools-version:6.0
import Foundation
import PackageDescription
let package = Package(
name: "CoreDataRepository",
defaultLocalization: "en",
platforms: .shared,
products: [
.library(
name: "CoreDataRepository",
targets: ["CoreDataRepository"]
),
],
dependencies: [
.package(
url: "https://github.com/pointfreeco/swift-custom-dump.git",
from: "1.0.0"
),
],
targets: [
.target(
name: "CoreDataRepository",
resources: [.process("Resources")]
),
.testTarget(
name: "CoreDataRepositoryTests",
dependencies: [
"CoreDataRepository",
.product(name: "CustomDump", package: "swift-custom-dump"),
"Internal",
]
),
.target(
name: "Internal",
dependencies: [
"CoreDataRepository",
]
),
]
)
extension [SupportedPlatform] {
static let shared: Self = if ProcessInfo.benchmarkingEnabled {
[
.iOS(.v15),
.macOS(.v12),
.tvOS(.v15),
.watchOS(.v8),
.macCatalyst(.v15),
.visionOS(.v1),
]
} else {
[
.iOS(.v15),
.macOS(.v13),
.tvOS(.v15),
.watchOS(.v8),
.macCatalyst(.v15),
.visionOS(.v1),
]
}
}
if ProcessInfo.benchmarkingEnabled {
package.dependencies += [
.package(
url: "https://github.com/ordo-one/package-benchmark.git",
from: "1.23.5"
),
]
// Benchmark of coredata-repository-benchmarks
package.targets += [
.executableTarget(
name: "coredata-repository-benchmarks",
dependencies: [
.product(name: "Benchmark", package: "package-benchmark"),
"CoreDataRepository",
"Internal",
],
path: "Benchmarks/coredata-repository-benchmarks",
plugins: [
.plugin(name: "BenchmarkPlugin", package: "package-benchmark"),
]
),
]
}
extension ProcessInfo {
static let benchmarkingEnabled: Bool = ["YES", "TRUE"]
.contains((ProcessInfo.processInfo.environment["BENCHMARKS"])?.uppercased())
}