@@ -51,14 +51,6 @@ public final class Core: Sendable {
5151 return nil
5252 }
5353
54- #if USE_STATIC_PLUGIN_INITIALIZATION
55- // In a package context, plugins are statically linked into the build system.
56- // Load specs from service plugins if requested since we don't have a Service in certain tests
57- // Here we don't have access to `core.pluginPaths` like we do in the call below,
58- // but it doesn't matter because it will return an empty array when USE_STATIC_PLUGIN_INITIALIZATION is defined.
59- await extraPluginRegistration ( pluginManager, [ ] )
60- #endif
61-
6254 let resolvedDeveloperPath : DeveloperPath
6355 do {
6456 if let resolved = developerPath {
@@ -81,6 +73,10 @@ public final class Core: Sendable {
8173 return nil
8274 }
8375
76+ // In a package context, plugins are statically linked into the build system.
77+ // Load specs from service plugins if requested since we don't have a Service in certain tests.
78+ await extraPluginRegistration ( pluginManager, Self . pluginPaths ( inferiorProductsPath: inferiorProductsPath, developerPath: resolvedDeveloperPath) )
79+
8480 let core : Core
8581 do {
8682 core = try await Core ( delegate: delegate, hostOperatingSystem: hostOperatingSystem, pluginManager: pluginManager. finalize ( ) , developerPath: resolvedDeveloperPath, resourceSearchPaths: resourceSearchPaths, inferiorProductsPath: inferiorProductsPath, additionalContentPaths: additionalContentPaths, environment: environment, buildServiceModTime: buildServiceModTime, connectionMode: connectionMode)
@@ -103,12 +99,6 @@ public final class Core: Sendable {
10399 }
104100 }
105101
106- #if !USE_STATIC_PLUGIN_INITIALIZATION
107- // In a package context, plugins are statically linked into the build system.
108- // Load specs from service plugins if requested since we don't have a Service in certain tests
109- await extraPluginRegistration ( core. pluginManager, core. pluginPaths)
110- #endif
111-
112102 await core. initializeSpecRegistry ( )
113103
114104 await core. initializePlatformRegistry ( )
@@ -313,19 +303,19 @@ public final class Core: Sendable {
313303 } ( )
314304
315305 /// The list of plugin search paths.
316- @ _spi ( Testing ) public lazy var pluginPaths : [ Path ] = {
317- # if USE_STATIC_PLUGIN_INITIALIZATION
318- // In a package context, plugins are statically linked into the build system.
319- return [ ]
320- #else
306+ private static func pluginPaths( inferiorProductsPath : Path ? , developerPath : DeveloperPath ) -> [ Path ] {
307+ if useStaticPluginInitialization {
308+ // In a package context, plugins are statically linked into the build system.
309+ return [ ]
310+ }
321311
322312 var result = [ Path] ( )
323313
324314 // If we are inferior, then search the built products directory first.
325315 //
326316 // FIXME: This is error prone, as it won't validate that any of these are installed in the expected location.
327317 // FIXME: If we remove, move or rename something in the built Xcode, then this will still find the old item in the installed Xcode.
328- if let inferiorProductsPath = self . inferiorProductsPath {
318+ if let inferiorProductsPath {
329319 result. append ( inferiorProductsPath)
330320 }
331321
@@ -359,8 +349,7 @@ public final class Core: Sendable {
359349 }
360350
361351 return result. map { $0. normalize ( ) }
362- #endif
363- } ( )
352+ }
364353
365354 /// The list of SDK search paths.
366355 @_spi ( Testing) public lazy var sdkPaths : [ ( Path , Platform ? ) ] = {
0 commit comments