Skip to content

Commit 33227e9

Browse files
authored
Merge pull request #2993 from neonichu/conditionalize-withoutEscapingSlashes
Conditionalize use of `.withoutEscapingSlashes`
2 parents 9b7f5b3 + 459b5dc commit 33227e9

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Sources/PackageLoading/ManifestLoader.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,11 @@ public final class ManifestLoader: ManifestLoaderProtocol {
545545

546546
let encoder = JSONEncoder()
547547
if #available(macOS 10.15, *) {
548+
#if os(macOS)
548549
encoder.outputFormatting = [.sortedKeys, .withoutEscapingSlashes]
550+
#else // `.withoutEscapingSlashes` is not in 5.3 on non-Darwin platforms
551+
encoder.outputFormatting = [.sortedKeys]
552+
#endif
549553
}
550554

551555
try keyHash.withData {

Sources/XCBuildSupport/PIFBuilder.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ public final class PIFBuilder {
9393
encoder.outputFormatting.insert(.sortedKeys)
9494
}
9595
if #available(macOS 10.15, *) {
96+
#if os(macOS) // `.withoutEscapingSlashes` is not in 5.3 on non-Darwin platforms
9697
encoder.outputFormatting.insert(.withoutEscapingSlashes)
98+
#endif
9799
}
98100
#endif
99101
}

0 commit comments

Comments
 (0)