diff --git a/Sources/XcodeProj/Extensions/Path+Extras.swift b/Sources/XcodeProj/Extensions/Path+Extras.swift index 4b76668eb..6327ac822 100644 --- a/Sources/XcodeProj/Extensions/Path+Extras.swift +++ b/Sources/XcodeProj/Extensions/Path+Extras.swift @@ -6,7 +6,7 @@ import PathKit // MARK: - Path extras. func systemGlob(_ pattern: UnsafePointer!, _ flags: Int32, _ errfunc: (@convention(c) (UnsafePointer?, Int32) -> Int32)!, _ vector_ptr: UnsafeMutablePointer!) -> Int32 { - #if os(macOS) + #if os(macOS) || os(iOS) return Darwin.glob(pattern, flags, errfunc, vector_ptr) #else return Glibc.glob(pattern, flags, errfunc, vector_ptr) diff --git a/Sources/XcodeProj/Extensions/String+md5.swift b/Sources/XcodeProj/Extensions/String+md5.swift index 1c0afa871..04be85b4c 100644 --- a/Sources/XcodeProj/Extensions/String+md5.swift +++ b/Sources/XcodeProj/Extensions/String+md5.swift @@ -31,7 +31,7 @@ extension String { return self } #if canImport(CryptoKit) - if #available(OSX 10.15, *) { + if #available(OSX 10.15, iOS 13.0, *) { return Insecure.MD5.hash(data: data) .withUnsafeBytes { Array($0) }.hexString } else { diff --git a/Tests/XcodeProjTests/Extensions/XCTestCase+Shell.swift b/Tests/XcodeProjTests/Extensions/XCTestCase+Shell.swift index 5ea654b4c..277c451bf 100644 --- a/Tests/XcodeProjTests/Extensions/XCTestCase+Shell.swift +++ b/Tests/XcodeProjTests/Extensions/XCTestCase+Shell.swift @@ -3,6 +3,7 @@ import Foundation /// Returns the output of running `executable` with `args`. Throws an error if the process exits indicating failure. @discardableResult func checkedOutput(_ executable: String, _ args: [String]) throws -> String? { + #if os(macOS) let process = Process() let output = Pipe() @@ -22,4 +23,7 @@ func checkedOutput(_ executable: String, _ args: [String]) throws -> String? { } return String(data: output.fileHandleForReading.readDataToEndOfFile(), encoding: .utf8) + #else + return nil + #endif }