@@ -13,6 +13,8 @@ var products: [Product] = [
13
13
. executable( name: " sourcekit-lsp " , targets: [ " sourcekit-lsp " ] ) ,
14
14
. library( name: " _SourceKitLSP " , targets: [ " SourceKitLSP " ] ) ,
15
15
. library( name: " LSPBindings " , targets: [ " LanguageServerProtocol " , " LanguageServerProtocolJSONRPC " ] ) ,
16
+ . library( name: " SwiftSourceKitPlugin " , type: . dynamic, targets: [ " SwiftSourceKitPlugin " ] ) ,
17
+ . library( name: " SwiftSourceKitClientPlugin " , type: . dynamic, targets: [ " SwiftSourceKitClientPlugin " ] ) ,
16
18
]
17
19
18
20
var targets : [ Target ] = [
@@ -111,6 +113,45 @@ var targets: [Target] = [
111
113
dependencies: [ ]
112
114
) ,
113
115
116
+ . target(
117
+ name: " CCompletionScoring " ,
118
+ dependencies: [ ]
119
+ ) ,
120
+
121
+ // MARK: CompletionScoring
122
+
123
+ . target(
124
+ name: " CompletionScoring " ,
125
+ dependencies: [ " CCompletionScoring " ] ,
126
+ swiftSettings: globalSwiftSettings
127
+ ) ,
128
+
129
+ . target(
130
+ name: " CompletionScoringForPlugin " ,
131
+ dependencies: [ " CCompletionScoring " ] ,
132
+ swiftSettings: globalSwiftSettings
133
+ ) ,
134
+
135
+ . testTarget(
136
+ name: " CompletionScoringTests " ,
137
+ dependencies: [ " CompletionScoring " , " CompletionScoringTestSupport " , " SwiftExtensions " ] ,
138
+ swiftSettings: globalSwiftSettings
139
+ ) ,
140
+
141
+ . testTarget(
142
+ name: " CompletionScoringPerfTests " ,
143
+ dependencies: [ " CompletionScoring " , " CompletionScoringTestSupport " , " SwiftExtensions " ] ,
144
+ swiftSettings: globalSwiftSettings
145
+ ) ,
146
+
147
+ // MARK: CompletionScoringTestSupport
148
+
149
+ . target(
150
+ name: " CompletionScoringTestSupport " ,
151
+ dependencies: [ " CompletionScoring " , " SwiftExtensions " ] ,
152
+ swiftSettings: globalSwiftSettings
153
+ ) ,
154
+
114
155
// MARK: CSKTestSupport
115
156
116
157
. target(
@@ -275,6 +316,21 @@ var targets: [Target] = [
275
316
swiftSettings: globalSwiftSettings + lspLoggingSwiftSettings
276
317
) ,
277
318
319
+ . target(
320
+ name: " SKLoggingForPlugin " ,
321
+ dependencies: [
322
+ " SwiftExtensionsForPlugin "
323
+ ] ,
324
+ exclude: [ " CMakeLists.txt " ] ,
325
+ swiftSettings: globalSwiftSettings + lspLoggingSwiftSettings + [
326
+ // We can't depend on swift-crypto in the plugin because we can't module-alias it due to https://github.com/swiftlang/swift-package-manager/issues/8119
327
+ . define( " NO_CRYPTO_DEPENDENCY " ) ,
328
+ . unsafeFlags( [
329
+ " -module-alias " , " SwiftExtensions=SwiftExtensionsForPlugin " ,
330
+ ] ) ,
331
+ ]
332
+ ) ,
333
+
278
334
. testTarget(
279
335
name: " SKLoggingTests " ,
280
336
dependencies: [
@@ -310,6 +366,21 @@ var targets: [Target] = [
310
366
swiftSettings: globalSwiftSettings
311
367
) ,
312
368
369
+ . target(
370
+ name: " SKUtilitiesForPlugin " ,
371
+ dependencies: [
372
+ " SKLoggingForPlugin " ,
373
+ " SwiftExtensionsForPlugin " ,
374
+ ] ,
375
+ exclude: [ " CMakeLists.txt " ] ,
376
+ swiftSettings: globalSwiftSettings + [
377
+ . unsafeFlags( [
378
+ " -module-alias " , " SKLogging=SKLoggingForPlugin " ,
379
+ " -module-alias " , " SwiftExtensions=SwiftExtensionsForPlugin " ,
380
+ ] )
381
+ ]
382
+ ) ,
383
+
313
384
. testTarget(
314
385
name: " SKUtilitiesTests " ,
315
386
dependencies: [
@@ -356,6 +427,22 @@ var targets: [Target] = [
356
427
swiftSettings: globalSwiftSettings
357
428
) ,
358
429
430
+ . target(
431
+ name: " SourceKitDForPlugin " ,
432
+ dependencies: [
433
+ " Csourcekitd " ,
434
+ " SKLoggingForPlugin " ,
435
+ " SwiftExtensionsForPlugin " ,
436
+ ] ,
437
+ exclude: [ " CMakeLists.txt " , " sourcekitd_uids.swift.gyb " ] ,
438
+ swiftSettings: globalSwiftSettings + [
439
+ . unsafeFlags( [
440
+ " -module-alias " , " SKLogging=SKLoggingForPlugin " ,
441
+ " -module-alias " , " SwiftExtensions=SwiftExtensionsForPlugin " ,
442
+ ] )
443
+ ]
444
+ ) ,
445
+
359
446
. testTarget(
360
447
name: " SourceKitDTests " ,
361
448
dependencies: [
@@ -433,6 +520,13 @@ var targets: [Target] = [
433
520
swiftSettings: globalSwiftSettings
434
521
) ,
435
522
523
+ . target(
524
+ name: " SwiftExtensionsForPlugin " ,
525
+ dependencies: [ " CAtomics " ] ,
526
+ exclude: [ " CMakeLists.txt " ] ,
527
+ swiftSettings: globalSwiftSettings
528
+ ) ,
529
+
436
530
. testTarget(
437
531
name: " SwiftExtensionsTests " ,
438
532
dependencies: [
@@ -443,6 +537,84 @@ var targets: [Target] = [
443
537
swiftSettings: globalSwiftSettings
444
538
) ,
445
539
540
+ // MARK: SwiftSourceKitClientPlugin
541
+
542
+ . target(
543
+ name: " SwiftSourceKitClientPlugin " ,
544
+ dependencies: [
545
+ " Csourcekitd " ,
546
+ " SourceKitDForPlugin " ,
547
+ " SwiftExtensionsForPlugin " ,
548
+ " SwiftSourceKitPluginCommon " ,
549
+ ] ,
550
+ swiftSettings: globalSwiftSettings + [
551
+ . unsafeFlags( [
552
+ " -module-alias " , " SourceKitD=SourceKitDForPlugin " ,
553
+ " -module-alias " , " SwiftExtensions=SwiftExtensionsForPlugin " ,
554
+ ] )
555
+ ] ,
556
+ linkerSettings: sourcekitLSPLinkSettings
557
+ ) ,
558
+
559
+ // MARK: SwiftSourceKitPluginCommon
560
+
561
+ . target(
562
+ name: " SwiftSourceKitPluginCommon " ,
563
+ dependencies: [
564
+ " Csourcekitd " ,
565
+ " SourceKitDForPlugin " ,
566
+ " SwiftExtensionsForPlugin " ,
567
+ " SKLoggingForPlugin " ,
568
+ ] ,
569
+ swiftSettings: globalSwiftSettings + [
570
+ . unsafeFlags( [
571
+ " -module-alias " , " SourceKitD=SourceKitDForPlugin " ,
572
+ " -module-alias " , " SwiftExtensions=SwiftExtensionsForPlugin " ,
573
+ " -module-alias " , " SKLogging=SKLoggingForPlugin " ,
574
+ ] )
575
+ ]
576
+ ) ,
577
+
578
+ // MARK: SwiftSourceKitPlugin
579
+
580
+ . target(
581
+ name: " SwiftSourceKitPlugin " ,
582
+ dependencies: [
583
+ " Csourcekitd " ,
584
+ " CompletionScoringForPlugin " ,
585
+ " SKUtilitiesForPlugin " ,
586
+ " SKLoggingForPlugin " ,
587
+ " SourceKitDForPlugin " ,
588
+ " SwiftSourceKitPluginCommon " ,
589
+ " SwiftExtensionsForPlugin " ,
590
+ ] ,
591
+ swiftSettings: globalSwiftSettings + [
592
+ . unsafeFlags( [
593
+ " -module-alias " , " CompletionScoring=CompletionScoringForPlugin " ,
594
+ " -module-alias " , " SKUtilities=SKUtilitiesForPlugin " ,
595
+ " -module-alias " , " SourceKitD=SourceKitDForPlugin " ,
596
+ " -module-alias " , " SKLogging=SKLoggingForPlugin " ,
597
+ " -module-alias " , " SwiftExtensions=SwiftExtensionsForPlugin " ,
598
+ ] )
599
+ ] ,
600
+ linkerSettings: sourcekitLSPLinkSettings
601
+ ) ,
602
+
603
+ . testTarget(
604
+ name: " SwiftSourceKitPluginTests " ,
605
+ dependencies: [
606
+ " BuildSystemIntegration " ,
607
+ " CompletionScoring " ,
608
+ " Csourcekitd " ,
609
+ " LanguageServerProtocol " ,
610
+ " SKTestSupport " ,
611
+ " SourceKitD " ,
612
+ " SwiftExtensions " ,
613
+ " ToolchainRegistry " ,
614
+ ] ,
615
+ swiftSettings: globalSwiftSettings
616
+ ) ,
617
+
446
618
// MARK: ToolchainRegistry
447
619
448
620
. target(
@@ -493,11 +665,11 @@ var targets: [Target] = [
493
665
if buildOnlyTests {
494
666
products = [ ]
495
667
targets = targets. compactMap { target in
496
- guard target. isTest || target. name == " SKTestSupport " else {
668
+ guard target. isTest || target. name. contains ( " TestSupport " ) else {
497
669
return nil
498
670
}
499
671
target. dependencies = target. dependencies. filter { dependency in
500
- if case . byNameItem( name: " SKTestSupport " , _) = dependency {
672
+ if case . byNameItem( name: let name , _) = dependency, name . contains ( " TestSupport " ) {
501
673
return true
502
674
}
503
675
return false
0 commit comments