Skip to content

Commit 10caa70

Browse files
committed
SwiftLintCore: initial pass for Windows support
Add some Windows specific handling for the paths in SwiftLintCore. The one piece that this change does not cover is the handling of `glob` as that is not an ISO C standard function and as such there is no `glob` on Windows. This will be worked through separately.
1 parent 1e0d18b commit 10caa70

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Source/SwiftLintFramework/Configuration/Configuration+Remote.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import SourceKittenFramework
55
import FoundationNetworking
66
#endif
77

8+
#if os(Windows)
9+
import func WinSDK.Sleep
10+
#endif
11+
812
internal extension Configuration.FileGraph.FilePath {
913
// MARK: - Properties: Remote Cache
1014
/// This should never be touched.
@@ -83,7 +87,11 @@ internal extension Configuration.FileGraph.FilePath {
8387
while true {
8488
if taskDone { break }
8589
if Date().timeIntervalSince(startDate) > timeout { task.cancel(); break }
90+
#if os(Windows)
91+
Sleep(50)
92+
#else
8693
usleep(50_000) // Sleep for 50 ms
94+
#endif
8795
}
8896

8997
// Handle wrong data

0 commit comments

Comments
 (0)