Skip to content

Commit 2c4da0a

Browse files
authored
Merge pull request #320 from compnerd/dot
SKCore: make `.` part of the extension
2 parents 241744d + 00d6ae0 commit 2c4da0a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Sources/SKCore/Toolchain.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,21 +145,21 @@ extension Toolchain {
145145
}
146146

147147
// If 'currentPlatform' is nil it's most likely an unknown linux flavor.
148-
let dylibExt = Platform.currentPlatform?.dynamicLibraryExtension ?? "so"
148+
let dylibExt = Platform.currentPlatform?.dynamicLibraryExtension ?? ".so"
149149

150150
let sourcekitdPath = libPath.appending(components: "sourcekitd.framework", "sourcekitd")
151151
if fs.isFile(sourcekitdPath) {
152152
self.sourcekitd = sourcekitdPath
153153
foundAny = true
154154
} else {
155-
let sourcekitdPath = libPath.appending(component: "libsourcekitdInProc.\(dylibExt)")
155+
let sourcekitdPath = libPath.appending(component: "libsourcekitdInProc\(dylibExt)")
156156
if fs.isFile(sourcekitdPath) {
157157
self.sourcekitd = sourcekitdPath
158158
foundAny = true
159159
}
160160
}
161161

162-
let libIndexStore = libPath.appending(components: "libIndexStore.\(dylibExt)")
162+
let libIndexStore = libPath.appending(components: "libIndexStore\(dylibExt)")
163163
if fs.isFile(libIndexStore) {
164164
self.libIndexStore = libIndexStore
165165
foundAny = true

Sources/SKSupport/Platform.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ extension Platform {
1717
/// The file extension used for a dynamic library on this platform.
1818
public var dynamicLibraryExtension: String {
1919
switch self {
20-
case .darwin: return "dylib"
21-
case .linux, .android: return "so"
20+
case .darwin: return ".dylib"
21+
case .linux, .android: return ".so"
2222
}
2323
}
2424
}

Tests/SKCoreTests/ToolchainRegistryTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,16 +526,16 @@ private func makeToolchain(
526526
makeExec(binPath.appending(component: "swiftc"))
527527
}
528528

529-
let dylibExt = Platform.currentPlatform?.dynamicLibraryExtension ?? "so"
529+
let dylibExt = Platform.currentPlatform?.dynamicLibraryExtension ?? ".so"
530530

531531
if sourcekitd {
532532
try! fs.createDirectory(libPath.appending(component: "sourcekitd.framework"))
533533
try! fs.writeFileContents(libPath.appending(components: "sourcekitd.framework", "sourcekitd") , bytes: "")
534534
}
535535
if sourcekitdInProc {
536-
try! fs.writeFileContents(libPath.appending(component: "libsourcekitdInProc.\(dylibExt)") , bytes: "")
536+
try! fs.writeFileContents(libPath.appending(component: "libsourcekitdInProc\(dylibExt)") , bytes: "")
537537
}
538538
if libIndexStore {
539-
try! fs.writeFileContents(libPath.appending(component: "libIndexStore.\(dylibExt)") , bytes: "")
539+
try! fs.writeFileContents(libPath.appending(component: "libIndexStore\(dylibExt)") , bytes: "")
540540
}
541541
}

0 commit comments

Comments
 (0)