Skip to content

Commit 4c3a2b5

Browse files
authored
Merge pull request #89 from DougGregor/macos-deployment-10.10
Set macOS minimum deployment target to 10.10.
2 parents 9595b51 + cf9d28e commit 4c3a2b5

File tree

4 files changed

+25
-9
lines changed

4 files changed

+25
-9
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import class Foundation.ProcessInfo
55
let package = Package(
66
name: "swift-driver",
77
platforms: [
8-
.macOS(.v10_13),
8+
.macOS(.v10_10),
99
],
1010
products: [
1111
.executable(

Sources/SwiftDriver/Execution/ParsableOutput.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ public struct ParsableMessage {
3030

3131
public func toJSON() throws -> Data {
3232
let encoder = JSONEncoder()
33-
encoder.outputFormatting = [.prettyPrinted, .sortedKeys]
33+
if #available(macOS 10.13, *) {
34+
encoder.outputFormatting = [.prettyPrinted, .sortedKeys]
35+
} else {
36+
encoder.outputFormatting = [.prettyPrinted]
37+
}
3438
return try encoder.encode(self)
3539
}
3640
}

Tests/SwiftDriverTests/AssertDiagnosticsTests.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,14 @@ class FailableTestCase: XCTestCase {
185185
return
186186
}
187187

188-
super.recordFailure(
189-
withDescription: description,
190-
inFile: filePath, atLine: lineNumber,
191-
expected: expected
192-
)
188+
if #available(macOS 10.13, *) {
189+
super.recordFailure(
190+
withDescription: description,
191+
inFile: filePath, atLine: lineNumber,
192+
expected: expected
193+
)
194+
} else {
195+
fatalError(description, line: UInt(lineNumber))
196+
}
193197
}
194198
}

Tests/SwiftDriverTests/Helpers/AssertDiagnostics.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,18 @@ final class DiagnosticVerifier {
111111
// Access to `actual` and `expected` must be synchronized on `queue`. (Even
112112
// reads should be, although we only enforce writes.)
113113
fileprivate var actual: [Diagnostic] = [] {
114-
didSet { dispatchPrecondition(condition: .onQueue(queue!)) }
114+
didSet {
115+
if #available(macOS 10.12, *) {
116+
dispatchPrecondition(condition: .onQueue(queue!))
117+
}
118+
}
115119
}
116120
fileprivate var expected: [Expectation] = [] {
117-
didSet { dispatchPrecondition(condition: .onQueue(queue!)) }
121+
didSet {
122+
if #available(macOS 10.12, *) {
123+
dispatchPrecondition(condition: .onQueue(queue!))
124+
}
125+
}
118126
}
119127

120128
// Access to `permitted` is not synchronized because it is only used from the

0 commit comments

Comments
 (0)