Skip to content

Commit

Permalink
Fix building for Xcode 13 and Swift 5.5
Browse files Browse the repository at this point in the history
So the issue is that in Xcode 13 there are new contents where before just were two directories to the different libPackageDescription like so:
  • Loading branch information
minuscorp authored Sep 28, 2021
1 parent 6e7415d commit e9f59db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/PackageConfig/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ enum Package {
let fileManager = FileManager.default

let swiftPMDir = swiftPath.replacingOccurrences(of: "bin/swiftc", with: "lib/swift/pm")
let versions = try! fileManager.contentsOfDirectory(atPath: swiftPMDir).filter { $0 != "llbuild" }
let versions = try! fileManager.contentsOfDirectory(atPath: swiftPMDir)
.filter { $0 != "llbuild" }
.filter { $0.first?.isNumber ?? false }

let latestVersion = versions.sorted().last!
var spmVersionDir = latestVersion
Expand Down

0 comments on commit e9f59db

Please sign in to comment.