@@ -145,7 +145,7 @@ private extension BuildSystemSpec {
145
145
private static func createBuiltInBuildSystemAdapter(
146
146
projectRoot: URL ,
147
147
messagesToSourceKitLSPHandler: any MessageHandler ,
148
- buildSystemTestHooks : BuildSystemTestHooks ,
148
+ buildSystemHooks : BuildSystemHooks ,
149
149
_ createBuildSystem: @Sendable ( _ connectionToSourceKitLSP: any Connection ) async throws -> BuiltInBuildSystem ?
150
150
) async -> BuildSystemAdapter ? {
151
151
let connectionToSourceKitLSP = LocalConnection (
@@ -164,7 +164,7 @@ private extension BuildSystemSpec {
164
164
let buildSystemAdapter = BuiltInBuildSystemAdapter (
165
165
underlyingBuildSystem: buildSystem,
166
166
connectionToSourceKitLSP: connectionToSourceKitLSP,
167
- buildSystemTestHooks : buildSystemTestHooks
167
+ buildSystemHooks : buildSystemHooks
168
168
)
169
169
let connectionToBuildSystem = LocalConnection (
170
170
receiverName: " \( type ( of: buildSystem) ) for \( projectRoot. lastPathComponent) "
@@ -178,7 +178,7 @@ private extension BuildSystemSpec {
178
178
func createBuildSystemAdapter(
179
179
toolchainRegistry: ToolchainRegistry ,
180
180
options: SourceKitLSPOptions ,
181
- buildSystemTestHooks testHooks : BuildSystemTestHooks ,
181
+ buildSystemHooks : BuildSystemHooks ,
182
182
messagesToSourceKitLSPHandler: any MessageHandler
183
183
) async -> BuildSystemAdapter ? {
184
184
switch self . kind {
@@ -199,7 +199,7 @@ private extension BuildSystemSpec {
199
199
return await Self . createBuiltInBuildSystemAdapter (
200
200
projectRoot: projectRoot,
201
201
messagesToSourceKitLSPHandler: messagesToSourceKitLSPHandler,
202
- buildSystemTestHooks : testHooks
202
+ buildSystemHooks : buildSystemHooks
203
203
) { connectionToSourceKitLSP in
204
204
CompilationDatabaseBuildSystem (
205
205
projectRoot: projectRoot,
@@ -214,26 +214,26 @@ private extension BuildSystemSpec {
214
214
return await Self . createBuiltInBuildSystemAdapter (
215
215
projectRoot: projectRoot,
216
216
messagesToSourceKitLSPHandler: messagesToSourceKitLSPHandler,
217
- buildSystemTestHooks : testHooks
217
+ buildSystemHooks : buildSystemHooks
218
218
) { connectionToSourceKitLSP in
219
219
try await SwiftPMBuildSystem (
220
220
projectRoot: projectRoot,
221
221
toolchainRegistry: toolchainRegistry,
222
222
options: options,
223
223
connectionToSourceKitLSP: connectionToSourceKitLSP,
224
- testHooks: testHooks . swiftPMTestHooks
224
+ testHooks: buildSystemHooks . swiftPMTestHooks
225
225
)
226
226
}
227
227
#else
228
228
return nil
229
229
#endif
230
- case . testBuildSystem :
230
+ case . injected ( let injector ) :
231
231
return await Self . createBuiltInBuildSystemAdapter (
232
232
projectRoot: projectRoot,
233
233
messagesToSourceKitLSPHandler: messagesToSourceKitLSPHandler,
234
- buildSystemTestHooks : testHooks
234
+ buildSystemHooks : buildSystemHooks
235
235
) { connectionToSourceKitLSP in
236
- TestBuildSystem ( projectRoot: projectRoot, connectionToSourceKitLSP: connectionToSourceKitLSP)
236
+ await injector . createBuildSystem ( projectRoot: projectRoot, connectionToSourceKitLSP: connectionToSourceKitLSP)
237
237
}
238
238
}
239
239
}
@@ -275,19 +275,6 @@ package actor BuildSystemManager: QueueBasedMessageHandler {
275
275
}
276
276
}
277
277
278
- /// If the underlying build system is a `TestBuildSystem`, return it. Otherwise, `nil`
279
- ///
280
- /// - Important: For testing purposes only.
281
- package var testBuildSystem : TestBuildSystem ? {
282
- get async {
283
- switch buildSystemAdapter {
284
- case . builtIn( let builtInBuildSystemAdapter, _) : return await builtInBuildSystemAdapter. testBuildSystem
285
- case . external: return nil
286
- case nil : return nil
287
- }
288
- }
289
- }
290
-
291
278
/// Provider of file to main file mappings.
292
279
private var mainFilesProvider : MainFilesProvider ?
293
280
@@ -367,7 +354,7 @@ package actor BuildSystemManager: QueueBasedMessageHandler {
367
354
toolchainRegistry: ToolchainRegistry ,
368
355
options: SourceKitLSPOptions ,
369
356
connectionToClient: BuildSystemManagerConnectionToClient ,
370
- buildSystemTestHooks : BuildSystemTestHooks
357
+ buildSystemHooks : BuildSystemHooks
371
358
) async {
372
359
self . toolchainRegistry = toolchainRegistry
373
360
self . options = options
@@ -376,7 +363,7 @@ package actor BuildSystemManager: QueueBasedMessageHandler {
376
363
self . buildSystemAdapter = await buildSystemSpec? . createBuildSystemAdapter (
377
364
toolchainRegistry: toolchainRegistry,
378
365
options: options,
379
- buildSystemTestHooks : buildSystemTestHooks ,
366
+ buildSystemHooks : buildSystemHooks ,
380
367
messagesToSourceKitLSPHandler: WeakMessageHandler ( self )
381
368
)
382
369
@@ -432,7 +419,7 @@ package actor BuildSystemManager: QueueBasedMessageHandler {
432
419
let adapter = BuiltInBuildSystemAdapter (
433
420
underlyingBuildSystem: legacyBuildServer,
434
421
connectionToSourceKitLSP: legacyBuildServer. connectionToSourceKitLSP,
435
- buildSystemTestHooks : buildSystemTestHooks
422
+ buildSystemHooks : buildSystemHooks
436
423
)
437
424
let connectionToBuildSystem = LocalConnection ( receiverName: " Legacy BSP server " )
438
425
connectionToBuildSystem. start ( handler: adapter)
0 commit comments