Skip to content

Commit f18eb2f

Browse files
committed
Only include benchmark dependency and target if ENV enables it
feature/add-unmanaged-protocol-for-types-that-prefer-a-unique-id-other-than-ObjectID
1 parent 6822454 commit f18eb2f

2 files changed

Lines changed: 26 additions & 92 deletions

File tree

Package.resolved

Lines changed: 1 addition & 73 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// swift-tools-version:5.10
22

33
import PackageDescription
4+
import Foundation
45

56
let package = Package(
67
name: "CoreDataRepository",
@@ -20,10 +21,6 @@ let package = Package(
2021
),
2122
],
2223
dependencies: [
23-
.package(
24-
url: "https://github.com/ordo-one/package-benchmark.git",
25-
from: "1.23.5"
26-
),
2724
.package(
2825
url: "https://github.com/pointfreeco/swift-custom-dump.git",
2926
from: "1.0.0"
@@ -66,18 +63,27 @@ extension [SwiftSetting] {
6663
]
6764
}
6865

69-
// Benchmark of coredata-repository-benchmarks
70-
package.targets += [
71-
.executableTarget(
72-
name: "coredata-repository-benchmarks",
73-
dependencies: [
74-
.product(name: "Benchmark", package: "package-benchmark"),
75-
"CoreDataRepository",
76-
"Internal",
77-
],
78-
path: "Benchmarks/coredata-repository-benchmarks",
79-
plugins: [
80-
.plugin(name: "BenchmarkPlugin", package: "package-benchmark"),
81-
]
82-
),
83-
]
66+
if ["YES", "TRUE"].contains((ProcessInfo.processInfo.environment["BENCHMARKS"])?.uppercased()) {
67+
package.dependencies += [
68+
.package(
69+
url: "https://github.com/ordo-one/package-benchmark.git",
70+
from: "1.23.5"
71+
),
72+
]
73+
74+
// Benchmark of coredata-repository-benchmarks
75+
package.targets += [
76+
.executableTarget(
77+
name: "coredata-repository-benchmarks",
78+
dependencies: [
79+
.product(name: "Benchmark", package: "package-benchmark"),
80+
"CoreDataRepository",
81+
"Internal",
82+
],
83+
path: "Benchmarks/coredata-repository-benchmarks",
84+
plugins: [
85+
.plugin(name: "BenchmarkPlugin", package: "package-benchmark"),
86+
]
87+
),
88+
]
89+
}

0 commit comments

Comments
 (0)