Skip to content

Commit 4c8916a

Browse files
committed
Merge SKSwiftPMWorkspace into BuildSystemIntegration
The SwiftPM build system integration was the only one in its own modules. Merge it into the `BuildSystemIntegration` modules next to eg. the compilation database build system.
1 parent 66f2d86 commit 4c8916a

File tree

12 files changed

+12
-70
lines changed

12 files changed

+12
-70
lines changed

Documentation/Modules.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ FIXME: Add link for BSP and version
1010

1111
### BuildSystemIntegration
1212

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.
13+
Defines the queries SourceKit-LSP can ask of a build system, like getting compiler arguments for a file, finding a target’s dependencies or preparing a target.
1414

1515
### CAtomics
1616

@@ -48,7 +48,7 @@ Contains the interface with which SourceKit-LSP queries the semantic index, addi
4848

4949
### SKLogging
5050

51-
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.
51+
Types that are API-compatible with OSLog that allow logging to OSLog when building for Apple platforms and logging to stderr or files on non-Apple platforms. This should not be dependent on any LSP specific types and be portable to other packages.
5252

5353
### SKOptions
5454

@@ -61,12 +61,6 @@ Contains SourceKit-LSP-specific helper functions. These fall into three differen
6161
- Functionality that can only be implemented by combining two lower-level modules that don't have a shared dependency, like `SKLogging` + `LanguageServerProtocol`
6262
- Types that should be sharable by the different modules that implement SourceKit-LSP but that are not generic enough to fit into `SwiftExtensions`, like `ExperimentalFeatures`.
6363

64-
### SKSwiftPMWorkspace
65-
66-
Implements the `BuildSystem` protocol for Swift packages.
67-
68-
FIXME: Merge this into the BuildSystem module once BuildSystemIntegration is split.
69-
7064
### SKTestSupport
7165

7266
A collection of utilities useful for writing tests for SourceKit-LSP and which are not specific to a single test module.

Package.swift

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ let package = Package(
6363
"SourceKitD",
6464
"SwiftExtensions",
6565
"ToolchainRegistry",
66+
.product(name: "SwiftPM-auto", package: "swift-package-manager"),
6667
.product(name: "SwiftPMDataModel-auto", package: "swift-package-manager"),
6768
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
6869
],
@@ -73,8 +74,10 @@ let package = Package(
7374
name: "BuildSystemIntegrationTests",
7475
dependencies: [
7576
"BuildSystemIntegration",
77+
"LanguageServerProtocol",
7678
"SKOptions",
7779
"SKTestSupport",
80+
"SourceKitLSP",
7881
"ToolchainRegistry",
7982
]
8083
),
@@ -267,39 +270,6 @@ let package = Package(
267270
]
268271
),
269272

270-
// MARK: SKSwiftPMWorkspace
271-
272-
.target(
273-
name: "SKSwiftPMWorkspace",
274-
dependencies: [
275-
"BuildServerProtocol",
276-
"BuildSystemIntegration",
277-
"LanguageServerProtocol",
278-
"SKLogging",
279-
"SKOptions",
280-
"SwiftExtensions",
281-
"ToolchainRegistry",
282-
.product(name: "SwiftPM-auto", package: "swift-package-manager"),
283-
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
284-
],
285-
exclude: ["CMakeLists.txt"]
286-
),
287-
288-
.testTarget(
289-
name: "SKSwiftPMWorkspaceTests",
290-
dependencies: [
291-
"BuildSystemIntegration",
292-
"LanguageServerProtocol",
293-
"SKOptions",
294-
"SKSwiftPMWorkspace",
295-
"SKTestSupport",
296-
"SourceKitLSP",
297-
"ToolchainRegistry",
298-
.product(name: "SwiftPM-auto", package: "swift-package-manager"),
299-
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
300-
]
301-
),
302-
303273
// MARK: SKTestSupport
304274

305275
.target(
@@ -359,7 +329,6 @@ let package = Package(
359329
"SKLogging",
360330
"SKOptions",
361331
"SKSupport",
362-
"SKSwiftPMWorkspace",
363332
"SourceKitD",
364333
"SwiftExtensions",
365334
"ToolchainRegistry",

Sources/BuildSystemIntegration/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ add_library(BuildSystemIntegration STATIC
1111
IndexTaskID.swift
1212
MainFilesProvider.swift
1313
PathPrefixMapping.swift
14-
SplitShellCommand.swift)
14+
SplitShellCommand.swift
15+
SwiftPMBuildSystem.swift)
1516
set_target_properties(BuildSystemIntegration PROPERTIES
1617
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
1718
target_link_libraries(BuildSystemIntegration PUBLIC
@@ -25,4 +26,6 @@ target_link_libraries(BuildSystemIntegration PUBLIC
2526
SwiftExtensions
2627
ToolchainRegistry
2728
PackageModel
28-
TSCBasic)
29+
TSCBasic
30+
Build
31+
SourceKitLSPAPI)

Sources/SKSwiftPMWorkspace/SwiftPMBuildSystem.swift renamed to Sources/BuildSystemIntegration/SwiftPMBuildSystem.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import Basics
1414
import Build
1515
import BuildServerProtocol
16-
import BuildSystemIntegration
1716
import Dispatch
1817
import Foundation
1918
import LanguageServerProtocol
@@ -40,7 +39,7 @@ import var TSCBasic.localFileSystem
4039
import func TSCBasic.resolveSymlinks
4140
import class ToolchainRegistry.Toolchain
4241

43-
typealias AbsolutePath = Basics.AbsolutePath
42+
fileprivate typealias AbsolutePath = Basics.AbsolutePath
4443

4544
#if canImport(SPMBuildCore)
4645
import SPMBuildCore

Sources/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ add_subdirectory(SemanticIndex)
1111
add_subdirectory(SKLogging)
1212
add_subdirectory(SKOptions)
1313
add_subdirectory(SKSupport)
14-
add_subdirectory(SKSwiftPMWorkspace)
1514
add_subdirectory(SourceKitLSP)
1615
add_subdirectory(SourceKitD)
1716
add_subdirectory(sourcekit-lsp)

Sources/SKSwiftPMWorkspace/CMakeLists.txt

Lines changed: 0 additions & 17 deletions
This file was deleted.

Sources/SourceKitLSP/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ target_link_libraries(SourceKitLSP PUBLIC
8282
SKLogging
8383
SKOptions
8484
SKSupport
85-
SKSwiftPMWorkspace
8685
SourceKitD
8786
SwiftExtensions
8887
ToolchainRegistry

Sources/SourceKitLSP/CreateBuildSystem.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import BuildSystemIntegration
1414
import LanguageServerProtocol
1515
import SKLogging
1616
import SKOptions
17-
import SKSwiftPMWorkspace
1817
import ToolchainRegistry
1918

2019
import struct TSCBasic.AbsolutePath

Sources/SourceKitLSP/SourceKitLSPServer.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import PackageLoading
2020
import SKLogging
2121
import SKOptions
2222
import SKSupport
23-
import SKSwiftPMWorkspace
2423
import SemanticIndex
2524
import SourceKitD
2625
import SwiftExtensions

Sources/SourceKitLSP/TestHooks.swift

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

13+
import BuildSystemIntegration
1314
import Foundation
1415
import LanguageServerProtocol
1516
import SKSupport
16-
import SKSwiftPMWorkspace
1717
import SemanticIndex
1818

1919
import struct TSCBasic.AbsolutePath

Tests/SKSwiftPMWorkspaceTests/SwiftPMBuildSystemTests.swift renamed to Tests/BuildSystemIntegrationTests/SwiftPMBuildSystemTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import Build
1515
import LanguageServerProtocol
1616
import PackageModel
1717
import SKOptions
18-
@_spi(Testing) import SKSwiftPMWorkspace
1918
import SKTestSupport
2019
import SourceKitLSP
2120
import TSCBasic

Tests/SourceKitLSPTests/CodeLensTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
import LSPTestSupport
1413
import LanguageServerProtocol
1514
import SKTestSupport
1615
import XCTest

0 commit comments

Comments
 (0)