Skip to content

Commit 2cef8b3

Browse files
committed
wip: use Context instead of ProcessInfo
1 parent 5b433c1 commit 2cef8b3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Package.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
// swift-tools-version: 5.6
22

33
import PackageDescription
4-
import class Foundation.ProcessInfo
4+
import Foundation
55

66
let packages: [Package.Dependency] = {
77
var dependencies: [Package.Dependency] = [
88
.package(url: "https://github.com/apple/swift-collections.git", from: "1.0.0"),
99
.package(url: "https://github.com/apple/swift-async-algorithms", from: "0.1.0"),
1010
]
1111

12-
if ProcessInfo.processInfo.environment["ASYNCOBJECTS_ENABLE_DEV"] != nil {
12+
if Context.environment["ASYNCOBJECTS_ENABLE_DEV"] != nil {
1313
dependencies.append(contentsOf: [
1414
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
1515
.package(url: "https://github.com/apple/swift-format", from: "0.50700.0"),
1616
])
1717
}
1818

19-
if ProcessInfo.processInfo.environment["ASYNCOBJECTS_ENABLE_LOGGING_LEVEL"] != nil {
19+
if Context.environment["ASYNCOBJECTS_ENABLE_LOGGING_LEVEL"] != nil {
2020
dependencies.append(
2121
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0")
2222
)
@@ -31,7 +31,7 @@ let dependencies: [Target.Dependency] = {
3131
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),
3232
]
3333

34-
if ProcessInfo.processInfo.environment["ASYNCOBJECTS_ENABLE_LOGGING_LEVEL"] != nil {
34+
if Context.environment["ASYNCOBJECTS_ENABLE_LOGGING_LEVEL"] != nil {
3535
dependencies.append(.product(name: "Logging", package: "swift-log"))
3636
}
3737

@@ -41,7 +41,7 @@ let dependencies: [Target.Dependency] = {
4141
let settings: [SwiftSetting] = {
4242
var settings: [SwiftSetting] = []
4343

44-
if ProcessInfo.processInfo.environment["SWIFTCI_CONCURRENCY_CHECKS"] != nil {
44+
if Context.environment["SWIFTCI_CONCURRENCY_CHECKS"] != nil {
4545
settings.append(
4646
.unsafeFlags([
4747
"-Xfrontend",
@@ -53,15 +53,15 @@ let settings: [SwiftSetting] = {
5353
)
5454
}
5555

56-
if ProcessInfo.processInfo.environment["SWIFTCI_WARNINGS_AS_ERRORS"] != nil {
56+
if Context.environment["SWIFTCI_WARNINGS_AS_ERRORS"] != nil {
5757
settings.append(.unsafeFlags(["-warnings-as-errors"]))
5858
}
5959

60-
if ProcessInfo.processInfo.environment["ASYNCOBJECTS_USE_CHECKEDCONTINUATION"] != nil {
60+
if Context.environment["ASYNCOBJECTS_USE_CHECKEDCONTINUATION"] != nil {
6161
settings.append(.define("ASYNCOBJECTS_USE_CHECKEDCONTINUATION"))
6262
}
6363

64-
if let level = ProcessInfo.processInfo.environment["ASYNCOBJECTS_ENABLE_LOGGING_LEVEL"] {
64+
if let level = Context.environment["ASYNCOBJECTS_ENABLE_LOGGING_LEVEL"] {
6565
if level.caseInsensitiveCompare("TRACE") == .orderedSame {
6666
settings.append(.define("ASYNCOBJECTS_ENABLE_LOGGING_LEVEL_TRACE"))
6767
} else if level.caseInsensitiveCompare("DEBUG") == .orderedSame {

0 commit comments

Comments
 (0)