diff --git a/utils/swift-xcodegen/Sources/SwiftXcodeGen/Path/FileExtension.swift b/utils/swift-xcodegen/Sources/SwiftXcodeGen/Path/FileExtension.swift index 1b2ea414a51..6e558dee57f 100644 --- a/utils/swift-xcodegen/Sources/SwiftXcodeGen/Path/FileExtension.swift +++ b/utils/swift-xcodegen/Sources/SwiftXcodeGen/Path/FileExtension.swift @@ -11,17 +11,23 @@ //===----------------------------------------------------------------------===// public enum FileExtension: String { + case asm case c + case cc + case cl case cpp case def case gyb case h + case inc case m case md case mm case modulemap case o + case proto case rst + case s case swift case swiftmodule case td diff --git a/utils/swift-xcodegen/Sources/SwiftXcodeGen/Path/PathProtocol.swift b/utils/swift-xcodegen/Sources/SwiftXcodeGen/Path/PathProtocol.swift index b44866b59e0..c9879076830 100644 --- a/utils/swift-xcodegen/Sources/SwiftXcodeGen/Path/PathProtocol.swift +++ b/utils/swift-xcodegen/Sources/SwiftXcodeGen/Path/PathProtocol.swift @@ -74,8 +74,10 @@ public extension PathProtocol { func hasExtension(_ exts: FileExtension...) -> Bool { // Note that querying `.extension` involves re-parsing, so only do it // once here. - let ext = storage.extension - return exts.contains(where: { ext == $0.rawValue }) + guard let ext = storage.extension else { return false } + return exts.contains(where: { + ext.compare($0.rawValue, options: .caseInsensitive) == .orderedSame + }) } func starts(with other: Self) -> Bool {