forked from swiftlang/sourcekit-lsp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
108 lines (93 loc) · 3.23 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// swift-tools-version:4.2
import PackageDescription
let package = Package(
name: "SourceKitLSP",
products: [
],
dependencies: [
// See 'Dependencies' below.
],
targets: [
.target(
name: "sourcekit-lsp",
dependencies: ["SourceKit", "LanguageServerProtocolJSONRPC"]),
.target(
name: "SourceKit",
dependencies: [
"LanguageServerProtocol",
"SKCore",
"Csourcekitd",
"SKSwiftPMWorkspace",
"IndexStoreDB",
// FIXME: we should break the jsonrpc dependency here.
"LanguageServerProtocolJSONRPC",
]),
.target(
name: "SKTestSupport",
dependencies: ["SourceKit"]),
.testTarget(
name: "SourceKitTests",
dependencies: ["SourceKit", "SKTestSupport"]),
.target(
name: "SKSwiftPMWorkspace",
dependencies: ["SwiftPM-auto", "SKCore"]),
.testTarget(
name: "SKSwiftPMWorkspaceTests",
dependencies: ["SKSwiftPMWorkspace", "SKTestSupport"]),
// Csourcekitd: C modules wrapper for sourcekitd.
.target(
name: "Csourcekitd",
dependencies: []),
// SKCore: Data structures and algorithms useful across the project, but not necessarily
// suitable for use in other packages.
.target(
name: "SKCore",
dependencies: ["LanguageServerProtocol"]),
.testTarget(
name: "SKCoreTests",
dependencies: ["SKCore", "SKTestSupport"]),
// jsonrpc: LSP connection using jsonrpc over pipes.
.target(
name: "LanguageServerProtocolJSONRPC",
dependencies: ["LanguageServerProtocol"]),
.testTarget(
name: "LanguageServerProtocolJSONRPCTests",
dependencies: ["LanguageServerProtocolJSONRPC", "SKTestSupport"]),
// LanguageServerProtocol: The core LSP types, suitable for any LSP implementation.
.target(
name: "LanguageServerProtocol",
dependencies: ["SKSupport"]),
.testTarget(
name: "LanguageServerProtocolTests",
dependencies: ["LanguageServerProtocol", "SKTestSupport"]),
// SKSupport: Data structures, algorithms and platform-abstraction code that might be generally
// useful to any Swift package. Similar in spirit to SwiftPM's Basic module.
.target(
name: "SKSupport",
dependencies: ["SPMUtility"]),
.testTarget(
name: "SKSupportTests",
dependencies: ["SKSupport", "SKTestSupport"]),
]
)
// MARK: Dependencies
// When building with the swift build-script, use local dependencies whose contents are controlled
// by the external environment. This allows sourcekit-lsp to take advantage of the automation used
// for building the swift toolchain, such as `update-checkout`, or cross-repo PR tests.
#if os(Linux)
import Glibc
#else
import Darwin.C
#endif
if getenv("SWIFTCI_USE_LOCAL_DEPS") == nil {
// Building standalone.
package.dependencies += [
.package(url: "https://github.com/apple/indexstore-db.git", .branch("master")),
.package(url: "https://github.com/apple/swift-package-manager.git", .branch("master")),
]
} else {
package.dependencies += [
.package(path: "../indexstore-db"),
.package(path: "../swiftpm"),
]
}