@@ -84,7 +84,7 @@ public actor SwiftPMWorkspace {
84
84
let workspacePath : TSCAbsolutePath
85
85
/// The directory containing `Package.swift`.
86
86
public var projectRoot : TSCAbsolutePath
87
- var packageGraph : PackageGraph
87
+ var modulesGraph : ModulesGraph
88
88
let workspace : Workspace
89
89
public let buildParameters : BuildParameters
90
90
let fileSystem : FileSystem
@@ -163,7 +163,7 @@ public actor SwiftPMWorkspace {
163
163
flags: buildSetup. flags
164
164
)
165
165
166
- self . packageGraph = try PackageGraph ( rootPackages: [ ] , dependencies: [ ] , binaryArtifacts: [ : ] )
166
+ self . modulesGraph = try ModulesGraph ( rootPackages: [ ] , dependencies: [ ] , binaryArtifacts: [ : ] )
167
167
self . reloadPackageStatusCallback = reloadPackageStatusCallback
168
168
169
169
try await reloadPackage ( )
@@ -213,7 +213,7 @@ extension SwiftPMWorkspace {
213
213
logger. log ( level: diagnostic. severity. asLogLevel, " SwiftPM log: \( diagnostic. description) " )
214
214
} )
215
215
216
- let packageGraph = try self . workspace. loadPackageGraph (
216
+ let modulesGraph = try self . workspace. loadPackageGraph (
217
217
rootInput: PackageGraphRootInput ( packages: [ AbsolutePath ( projectRoot) ] ) ,
218
218
forceResolvedVersions: true ,
219
219
availableLibraries: self . buildParameters. toolchain. providedLibraries,
@@ -223,7 +223,7 @@ extension SwiftPMWorkspace {
223
223
let plan = try BuildPlan (
224
224
productsBuildParameters: buildParameters,
225
225
toolsBuildParameters: buildParameters,
226
- graph: packageGraph ,
226
+ graph: modulesGraph ,
227
227
fileSystem: fileSystem,
228
228
observabilityScope: observabilitySystem. topScope
229
229
)
@@ -232,10 +232,10 @@ extension SwiftPMWorkspace {
232
232
/// Make sure to execute any throwing statements before setting any
233
233
/// properties because otherwise we might end up in an inconsistent state
234
234
/// with only some properties modified.
235
- self . packageGraph = packageGraph
235
+ self . modulesGraph = modulesGraph
236
236
237
237
self . fileToTarget = [ AbsolutePath: SwiftBuildTarget] (
238
- packageGraph . allTargets. flatMap { target in
238
+ modulesGraph . allTargets. flatMap { target in
239
239
return target. sources. paths. compactMap {
240
240
guard let buildTarget = buildDescription. getBuildTarget ( for: target) else {
241
241
return nil
@@ -250,7 +250,7 @@ extension SwiftPMWorkspace {
250
250
)
251
251
252
252
self . sourceDirToTarget = [ AbsolutePath: SwiftBuildTarget] (
253
- packageGraph . allTargets. compactMap { ( target) -> ( AbsolutePath , SwiftBuildTarget ) ? in
253
+ modulesGraph . allTargets. compactMap { ( target) -> ( AbsolutePath , SwiftBuildTarget ) ? in
254
254
guard let buildTarget = buildDescription. getBuildTarget ( for: target) else {
255
255
return nil
256
256
}
@@ -351,7 +351,7 @@ extension SwiftPMWorkspace: SKCore.BuildSystem {
351
351
352
352
return self . workspace. fileAffectsSwiftOrClangBuildSettings (
353
353
filePath: path,
354
- packageGraph: self . packageGraph
354
+ packageGraph: self . modulesGraph
355
355
)
356
356
case . changed:
357
357
return fileURL. lastPathComponent == " Package.swift "
@@ -389,7 +389,7 @@ extension SwiftPMWorkspace {
389
389
/// Retrieve settings for a package manifest (Package.swift).
390
390
private func settings( forPackageManifest path: AbsolutePath ) throws -> FileBuildSettings ? {
391
391
func impl( _ path: AbsolutePath ) -> FileBuildSettings ? {
392
- for package in packageGraph . packages where path == package . manifest. path {
392
+ for package in modulesGraph . packages where path == package . manifest. path {
393
393
let compilerArgs = workspace. interpreterFlags ( for: package . path) + [ path. pathString]
394
394
return FileBuildSettings ( compilerArguments: compilerArgs)
395
395
}
0 commit comments