Skip to content

Commit 5744562

Browse files
authored
Avoid jextracting +SwiftJava files (swiftlang#378)
1 parent 3c36c76 commit 5744562

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Sources/JExtractSwiftLib/Swift2Java.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,15 @@ public struct SwiftToJava {
124124
}
125125

126126
func canExtract(from file: URL) -> Bool {
127-
file.lastPathComponent.hasSuffix(".swift") ||
128-
file.lastPathComponent.hasSuffix(".swiftinterface")
127+
guard file.lastPathComponent.hasSuffix(".swift") ||
128+
file.lastPathComponent.hasSuffix(".swiftinterface") else {
129+
return false
130+
}
131+
if file.lastPathComponent.hasSuffix("+SwiftJava.swift") {
132+
return false
133+
}
134+
135+
return true
129136
}
130137

131138
}

0 commit comments

Comments
 (0)