Skip to content

Commit f06b2aa

Browse files
committed
Fix SwiftPM deprecation warnings
1 parent b3d2df7 commit f06b2aa

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Sources/SKSwiftPMWorkspace/SwiftPMWorkspace.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public actor SwiftPMWorkspace {
8484
let workspacePath: TSCAbsolutePath
8585
/// The directory containing `Package.swift`.
8686
public var projectRoot: TSCAbsolutePath
87-
var packageGraph: PackageGraph
87+
var modulesGraph: ModulesGraph
8888
let workspace: Workspace
8989
public let buildParameters: BuildParameters
9090
let fileSystem: FileSystem
@@ -163,7 +163,7 @@ public actor SwiftPMWorkspace {
163163
flags: buildSetup.flags
164164
)
165165

166-
self.packageGraph = try PackageGraph(rootPackages: [], dependencies: [], binaryArtifacts: [:])
166+
self.modulesGraph = try ModulesGraph(rootPackages: [], dependencies: [], binaryArtifacts: [:])
167167
self.reloadPackageStatusCallback = reloadPackageStatusCallback
168168

169169
try await reloadPackage()
@@ -213,7 +213,7 @@ extension SwiftPMWorkspace {
213213
logger.log(level: diagnostic.severity.asLogLevel, "SwiftPM log: \(diagnostic.description)")
214214
})
215215

216-
let packageGraph = try self.workspace.loadPackageGraph(
216+
let modulesGraph = try self.workspace.loadPackageGraph(
217217
rootInput: PackageGraphRootInput(packages: [AbsolutePath(projectRoot)]),
218218
forceResolvedVersions: true,
219219
availableLibraries: self.buildParameters.toolchain.providedLibraries,
@@ -223,7 +223,7 @@ extension SwiftPMWorkspace {
223223
let plan = try BuildPlan(
224224
productsBuildParameters: buildParameters,
225225
toolsBuildParameters: buildParameters,
226-
graph: packageGraph,
226+
graph: modulesGraph,
227227
fileSystem: fileSystem,
228228
observabilityScope: observabilitySystem.topScope
229229
)
@@ -232,10 +232,10 @@ extension SwiftPMWorkspace {
232232
/// Make sure to execute any throwing statements before setting any
233233
/// properties because otherwise we might end up in an inconsistent state
234234
/// with only some properties modified.
235-
self.packageGraph = packageGraph
235+
self.modulesGraph = modulesGraph
236236

237237
self.fileToTarget = [AbsolutePath: SwiftBuildTarget](
238-
packageGraph.allTargets.flatMap { target in
238+
modulesGraph.allTargets.flatMap { target in
239239
return target.sources.paths.compactMap {
240240
guard let buildTarget = buildDescription.getBuildTarget(for: target) else {
241241
return nil
@@ -250,7 +250,7 @@ extension SwiftPMWorkspace {
250250
)
251251

252252
self.sourceDirToTarget = [AbsolutePath: SwiftBuildTarget](
253-
packageGraph.allTargets.compactMap { (target) -> (AbsolutePath, SwiftBuildTarget)? in
253+
modulesGraph.allTargets.compactMap { (target) -> (AbsolutePath, SwiftBuildTarget)? in
254254
guard let buildTarget = buildDescription.getBuildTarget(for: target) else {
255255
return nil
256256
}
@@ -351,7 +351,7 @@ extension SwiftPMWorkspace: SKCore.BuildSystem {
351351

352352
return self.workspace.fileAffectsSwiftOrClangBuildSettings(
353353
filePath: path,
354-
packageGraph: self.packageGraph
354+
packageGraph: self.modulesGraph
355355
)
356356
case .changed:
357357
return fileURL.lastPathComponent == "Package.swift"
@@ -389,7 +389,7 @@ extension SwiftPMWorkspace {
389389
/// Retrieve settings for a package manifest (Package.swift).
390390
private func settings(forPackageManifest path: AbsolutePath) throws -> FileBuildSettings? {
391391
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 {
393393
let compilerArgs = workspace.interpreterFlags(for: package.path) + [path.pathString]
394394
return FileBuildSettings(compilerArguments: compilerArgs)
395395
}

0 commit comments

Comments
 (0)