Skip to content

Commit c37595c

Browse files
authored
Widen apple/swift-log support range when Swift compiler >=6.1 (#529)
1 parent 0e99ef4 commit c37595c

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

Package.swift

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,6 @@ let package = Package(
184184
url: "https://github.com/stackotter/swift-benchmark",
185185
.upToNextMinor(from: "0.2.0")
186186
),
187-
.package(
188-
url: "https://github.com/apple/swift-log.git",
189-
// swift-log bumped its swift-tools-version in 1.7.0
190-
.upToNextMinor(from: "1.6.4")
191-
),
192187
.package(
193188
url: "https://github.com/swhitty/swift-mutex",
194189
.upToNextMinor(from: "0.0.6")
@@ -375,6 +370,26 @@ let package = Package(
375370
]
376371
)
377372

373+
// Newer versions of swift-log only support Swift >=6.1, and SwiftPM doesn't
374+
// seem to want to use the tools-version of the package during resolution
375+
// (even though I could swear it has in the past), so we have to change the
376+
// version requirement based on compiler version.
377+
#if compiler(<6.1)
378+
package.dependencies.append(
379+
.package(
380+
url: "https://github.com/apple/swift-log.git",
381+
.upToNextMinor(from: "1.6.4")
382+
)
383+
)
384+
#else
385+
package.dependencies.append(
386+
.package(
387+
url: "https://github.com/apple/swift-log.git",
388+
from: "1.6.4"
389+
)
390+
)
391+
#endif
392+
378393
// Add AndroidBackend if the Swift version is new enough and we're not using xcodebuild
379394
if androidBackendSupported {
380395
package.dependencies += [

0 commit comments

Comments
 (0)