Skip to content

Commit 66f2d86

Browse files
committed
Rename SKCore to BuildSystemIntegration
1 parent 6d34d70 commit 66f2d86

File tree

49 files changed

+86
-108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+86
-108
lines changed

Documentation/Modules.md

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Swift types to represent the [Build Server Protocol (BSP) specification, version
88

99
FIXME: Add link for BSP and version
1010

11+
### BuildSystemIntegration
12+
13+
Defines the queries SourceKit-LSP can ask of a a build system, like getting compiler arguments for a file. Finding a target’s dependencies or preparing a target.
14+
1115
### CAtomics
1216

1317
Implementation of atomics for Swift using C. Once we can raise our deployment target to use the `Atomic` type from the Swift standard library, this module should be removed.
@@ -42,31 +46,6 @@ A connection to or from a SourceKit-LSP server. Since message parsing can fail,
4246

4347
Contains the interface with which SourceKit-LSP queries the semantic index, adding up-to-date checks on top of the indexstore-db API. Also implements the types that manage background indexing.
4448

45-
### SKCore
46-
47-
FIXME: Currently serves two independent purposes and should be split up into two modules
48-
49-
#### BuildSystem
50-
51-
Defines the queries SourceKit-LSP can ask of a a build system, like getting compiler arguments for a file. Finding a target’s dependencies or preparing a target.
52-
53-
This includes:
54-
- BuildConfiguration.swift
55-
- BuildServerBuildSystem.swift
56-
- BuildSetup.swift
57-
- BuildSystem.swift
58-
- BuildSystemDelegate.swift
59-
- BuildSystemManager.swift
60-
- CompilationDatabase.swift
61-
- CompilationDatabaseBuildSystem.swift
62-
- FallbackBuildSystem.swift
63-
- FileBuildSettings.swift
64-
- IndexTaskID.swift
65-
- MainFilesProvider.swift
66-
- PathPrefixMapping.swift
67-
- SplitShellCommand.swift
68-
- WorkspaceType.swift
69-
7049
### SKLogging
7150

7251
Types that are API-compatible with OSLog to allow logging to OSLog when building for Darwin platforms and logging to stderr or files on non-Darwin platforms. This should not be dependent on any LSP specific types and be portable to other packages.
@@ -86,7 +65,7 @@ Contains SourceKit-LSP-specific helper functions. These fall into three differen
8665

8766
Implements the `BuildSystem` protocol for Swift packages.
8867

89-
FIXME: Merge this into the BuildSystem module once SKCore is split.
68+
FIXME: Merge this into the BuildSystem module once BuildSystemIntegration is split.
9069

9170
### SKTestSupport
9271

Package.swift

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ let package = Package(
2424
.executableTarget(
2525
name: "sourcekit-lsp",
2626
dependencies: [
27+
"BuildSystemIntegration",
2728
"Diagnose",
2829
"LanguageServerProtocol",
2930
"LanguageServerProtocolJSONRPC",
30-
"SKCore",
3131
"SKOptions",
3232
"SKSupport",
3333
"SourceKitLSP",
@@ -49,6 +49,36 @@ let package = Package(
4949
exclude: ["CMakeLists.txt"]
5050
),
5151

52+
// MARK: BuildSystemIntegration
53+
54+
.target(
55+
name: "BuildSystemIntegration",
56+
dependencies: [
57+
"BuildServerProtocol",
58+
"LanguageServerProtocol",
59+
"LanguageServerProtocolJSONRPC",
60+
"SKLogging",
61+
"SKOptions",
62+
"SKSupport",
63+
"SourceKitD",
64+
"SwiftExtensions",
65+
"ToolchainRegistry",
66+
.product(name: "SwiftPMDataModel-auto", package: "swift-package-manager"),
67+
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
68+
],
69+
exclude: ["CMakeLists.txt"]
70+
),
71+
72+
.testTarget(
73+
name: "BuildSystemIntegrationTests",
74+
dependencies: [
75+
"BuildSystemIntegration",
76+
"SKOptions",
77+
"SKTestSupport",
78+
"ToolchainRegistry",
79+
]
80+
),
81+
5282
// MARK: CAtomics
5383

5484
.target(
@@ -76,8 +106,8 @@ let package = Package(
76106
.target(
77107
name: "Diagnose",
78108
dependencies: [
109+
"BuildSystemIntegration",
79110
"InProcessClient",
80-
"SKCore",
81111
"SKLogging",
82112
"SKOptions",
83113
"SKSupport",
@@ -97,8 +127,8 @@ let package = Package(
97127
.testTarget(
98128
name: "DiagnoseTests",
99129
dependencies: [
130+
"BuildSystemIntegration",
100131
"Diagnose",
101-
"SKCore",
102132
"SKLogging",
103133
"SKTestSupport",
104134
"SourceKitD",
@@ -112,8 +142,8 @@ let package = Package(
112142
.target(
113143
name: "InProcessClient",
114144
dependencies: [
145+
"BuildSystemIntegration",
115146
"LanguageServerProtocol",
116-
"SKCore",
117147
"SKLogging",
118148
"SKOptions",
119149
"SourceKitLSP",
@@ -162,8 +192,8 @@ let package = Package(
162192
.target(
163193
name: "SemanticIndex",
164194
dependencies: [
195+
"BuildSystemIntegration",
165196
"LanguageServerProtocol",
166-
"SKCore",
167197
"SKLogging",
168198
"SwiftExtensions",
169199
"ToolchainRegistry",
@@ -181,36 +211,6 @@ let package = Package(
181211
]
182212
),
183213

184-
// MARK: SKCore
185-
186-
.target(
187-
name: "SKCore",
188-
dependencies: [
189-
"BuildServerProtocol",
190-
"LanguageServerProtocol",
191-
"LanguageServerProtocolJSONRPC",
192-
"SKLogging",
193-
"SKOptions",
194-
"SKSupport",
195-
"SourceKitD",
196-
"SwiftExtensions",
197-
"ToolchainRegistry",
198-
.product(name: "SwiftPMDataModel-auto", package: "swift-package-manager"),
199-
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
200-
],
201-
exclude: ["CMakeLists.txt"]
202-
),
203-
204-
.testTarget(
205-
name: "SKCoreTests",
206-
dependencies: [
207-
"SKCore",
208-
"SKOptions",
209-
"SKTestSupport",
210-
"ToolchainRegistry",
211-
]
212-
),
213-
214214
// MARK: SKLogging
215215

216216
.target(
@@ -273,8 +273,8 @@ let package = Package(
273273
name: "SKSwiftPMWorkspace",
274274
dependencies: [
275275
"BuildServerProtocol",
276+
"BuildSystemIntegration",
276277
"LanguageServerProtocol",
277-
"SKCore",
278278
"SKLogging",
279279
"SKOptions",
280280
"SwiftExtensions",
@@ -288,8 +288,8 @@ let package = Package(
288288
.testTarget(
289289
name: "SKSwiftPMWorkspaceTests",
290290
dependencies: [
291+
"BuildSystemIntegration",
291292
"LanguageServerProtocol",
292-
"SKCore",
293293
"SKOptions",
294294
"SKSwiftPMWorkspace",
295295
"SKTestSupport",
@@ -305,11 +305,11 @@ let package = Package(
305305
.target(
306306
name: "SKTestSupport",
307307
dependencies: [
308+
"BuildSystemIntegration",
308309
"CSKTestSupport",
309310
"InProcessClient",
310311
"LanguageServerProtocol",
311312
"LanguageServerProtocolJSONRPC",
312-
"SKCore",
313313
"SKLogging",
314314
"SKOptions",
315315
"SKSupport",
@@ -338,8 +338,8 @@ let package = Package(
338338
.testTarget(
339339
name: "SourceKitDTests",
340340
dependencies: [
341+
"BuildSystemIntegration",
341342
"SourceKitD",
342-
"SKCore",
343343
"SKTestSupport",
344344
"SwiftExtensions",
345345
"ToolchainRegistry",
@@ -352,10 +352,10 @@ let package = Package(
352352
name: "SourceKitLSP",
353353
dependencies: [
354354
"BuildServerProtocol",
355+
"BuildSystemIntegration",
355356
"LanguageServerProtocol",
356357
"LanguageServerProtocolJSONRPC",
357358
"SemanticIndex",
358-
"SKCore",
359359
"SKLogging",
360360
"SKOptions",
361361
"SKSupport",
@@ -382,9 +382,9 @@ let package = Package(
382382
name: "SourceKitLSPTests",
383383
dependencies: [
384384
"BuildServerProtocol",
385+
"BuildSystemIntegration",
385386
"LanguageServerProtocol",
386387
"SemanticIndex",
387-
"SKCore",
388388
"SKLogging",
389389
"SKOptions",
390390
"SKSupport",

Sources/SKCore/CMakeLists.txt renamed to Sources/BuildSystemIntegration/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
add_library(SKCore STATIC
2+
add_library(BuildSystemIntegration STATIC
33
BuildServerBuildSystem.swift
44
BuildSystem.swift
55
BuildSystemDelegate.swift
@@ -12,9 +12,9 @@ add_library(SKCore STATIC
1212
MainFilesProvider.swift
1313
PathPrefixMapping.swift
1414
SplitShellCommand.swift)
15-
set_target_properties(SKCore PROPERTIES
15+
set_target_properties(BuildSystemIntegration PROPERTIES
1616
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
17-
target_link_libraries(SKCore PUBLIC
17+
target_link_libraries(BuildSystemIntegration PUBLIC
1818
BuildServerProtocol
1919
LanguageServerProtocol
2020
LanguageServerProtocolJSONRPC

Sources/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-package-name SourceKitLSP>")
22
add_subdirectory(BuildServerProtocol)
3+
add_subdirectory(BuildSystemIntegration)
34
add_subdirectory(CAtomics)
45
add_subdirectory(Csourcekitd)
56
add_subdirectory(Diagnose)
67
add_subdirectory(InProcessClient)
78
add_subdirectory(LanguageServerProtocol)
89
add_subdirectory(LanguageServerProtocolJSONRPC)
910
add_subdirectory(SemanticIndex)
10-
add_subdirectory(SKCore)
1111
add_subdirectory(SKLogging)
1212
add_subdirectory(SKOptions)
1313
add_subdirectory(SKSupport)

Sources/Diagnose/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ set_target_properties(Diagnose PROPERTIES
2525
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
2626

2727
target_link_libraries(Diagnose PUBLIC
28+
BuildSystemIntegration
2829
InProcessClient
29-
SKCore
3030
SKLogging
3131
SKOptions
3232
SourceKitD

Sources/Diagnose/SwiftFrontendCrashScraper.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
import BuildSystemIntegration
1314
import Foundation
14-
import SKCore
1515

1616
struct SwiftFrontendCrashScraper {
1717
/// Information we care about in a `.ips` crash report.

Sources/InProcessClient/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ set_target_properties(InProcessClient PROPERTIES
66
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
77

88
target_link_libraries(InProcessClient PUBLIC
9+
BuildSystemIntegration
910
LanguageServerProtocol
10-
SKCore
1111
SKLogging
1212
SKOptions
1313
SourceKitLSP

Sources/InProcessClient/InProcessSourceKitLSPClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
import BuildSystemIntegration
1314
import LanguageServerProtocol
14-
import SKCore
1515
import SKOptions
1616
import SKSupport
1717
import SourceKitLSP

Sources/SKSwiftPMWorkspace/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ set_target_properties(SKSwiftPMWorkspace PROPERTIES
55
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
66
target_link_libraries(SKSwiftPMWorkspace PRIVATE
77
BuildServerProtocol
8+
BuildSystemIntegration
89
LanguageServerProtocol
9-
SKCore
1010
SKLogging
1111
SKOptions
1212
SwiftExtensions

Sources/SKSwiftPMWorkspace/SwiftPMBuildSystem.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
import Basics
1414
import Build
1515
import BuildServerProtocol
16+
import BuildSystemIntegration
1617
import Dispatch
1718
import Foundation
1819
import LanguageServerProtocol
1920
import PackageGraph
2021
import PackageLoading
2122
import PackageModel
22-
import SKCore
2323
import SKLogging
2424
import SKOptions
2525
import SKSupport
@@ -122,9 +122,9 @@ package actor SwiftPMBuildSystem {
122122
}
123123

124124
/// Delegate to handle any build system events.
125-
package weak var delegate: SKCore.BuildSystemDelegate? = nil
125+
package weak var delegate: BuildSystemIntegration.BuildSystemDelegate? = nil
126126

127-
package func setDelegate(_ delegate: SKCore.BuildSystemDelegate?) async {
127+
package func setDelegate(_ delegate: BuildSystemIntegration.BuildSystemDelegate?) async {
128128
self.delegate = delegate
129129
}
130130

@@ -440,7 +440,7 @@ fileprivate struct NonFileURIError: Error, CustomStringConvertible {
440440
}
441441
}
442442

443-
extension SwiftPMBuildSystem: SKCore.BuildSystem {
443+
extension SwiftPMBuildSystem: BuildSystemIntegration.BuildSystem {
444444
package nonisolated var supportsPreparation: Bool { true }
445445

446446
package var buildPath: TSCAbsolutePath {

Sources/SKTestSupport/IndexedSingleSwiftFileTestProject.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
@_spi(Testing) import BuildSystemIntegration
1314
import Foundation
1415
import LanguageServerProtocol
15-
@_spi(Testing) import SKCore
1616
import SKOptions
1717
import SourceKitLSP
1818
import TSCBasic

Sources/SemanticIndex/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ add_library(SemanticIndex STATIC
1313
set_target_properties(SemanticIndex PROPERTIES
1414
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
1515
target_link_libraries(SemanticIndex PRIVATE
16+
BuildSystemIntegration
1617
LanguageServerProtocol
17-
SKCore
1818
SKLogging
1919
SwiftExtensions
2020
ToolchainRegistry

Sources/SemanticIndex/PreparationTaskDescription.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
import BuildSystemIntegration
1314
import Foundation
1415
import LanguageServerProtocol
15-
import SKCore
1616
import SKLogging
1717
import SKSupport
1818

0 commit comments

Comments
 (0)