Skip to content

Commit d18dc91

Browse files
committed
mend
1 parent c30c2cc commit d18dc91

File tree

7 files changed

+134
-126
lines changed

7 files changed

+134
-126
lines changed

Sources/Commands/APIDigester.swift

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ struct APIDigesterBaselineDumper {
3333
/// The input build parameters.
3434
let inputBuildParameters: BuildParameters
3535

36-
/// The manifest loader.
37-
//let manifestLoader: ManifestLoaderProtocol
38-
39-
/// The repository manager.
40-
//let repositoryManager: RepositoryManager
41-
4236
/// The API digester tool.
4337
let apiDigesterTool: SwiftAPIDigester
4438

@@ -49,8 +43,6 @@ struct APIDigesterBaselineDumper {
4943
baselineRevision: Revision,
5044
packageRoot: AbsolutePath,
5145
buildParameters: BuildParameters,
52-
//manifestLoader: ManifestLoaderProtocol,
53-
//repositoryManager: RepositoryManager,
5446
apiDigesterTool: SwiftAPIDigester,
5547
diags: DiagnosticsEngine
5648
) {
@@ -106,9 +98,7 @@ struct APIDigesterBaselineDumper {
10698

10799
// Create the workspace for this package.
108100
let workspace = try Workspace(
109-
forRootPackage: baselinePackageRoot//,
110-
//manifestLoader: manifestLoader,
111-
//repositoryManager: repositoryManager
101+
forRootPackage: baselinePackageRoot
112102
)
113103

114104
let graph = try workspace.loadPackageGraph(
@@ -124,7 +114,7 @@ struct APIDigesterBaselineDumper {
124114

125115
// Update the data path input build parameters so it's built in the sandbox.
126116
var buildParameters = inputBuildParameters
127-
buildParameters.dataPath = workspace.dataPath
117+
buildParameters.dataPath = workspace.location.workingDirectory
128118

129119
// Build the baseline module.
130120
let buildOp = BuildOperation(

Sources/Commands/SwiftPackageTool.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,10 @@ extension SwiftPackageTool {
364364
try buildOp.build()
365365

366366
// Dump JSON for the baseline package.
367-
//let workspace = try swiftTool.getActiveWorkspace()
368367
let baselineDumper = try APIDigesterBaselineDumper(
369368
baselineRevision: baselineRevision,
370369
packageRoot: swiftTool.getPackageRoot(),
371370
buildParameters: buildOp.buildParameters,
372-
//manifestLoader: workspace.manifestLoader,
373-
//repositoryManager: workspace.repositoryManager,
374371
apiDigesterTool: apiDigesterTool,
375372
diags: swiftTool.diagnostics
376373
)

Sources/Commands/SwiftTool.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,11 @@ public class SwiftTool {
553553
let isXcodeBuildSystemEnabled = self.options.buildSystem == .xcode
554554
let workspace = try Workspace(
555555
fileSystem: localFileSystem,
556-
dataPath: buildPath,
557-
editablesPath: try editablesPath(),
558-
resolvedVersionsFilePath: try resolvedVersionsFilePath(),
556+
location: .init(
557+
workingDirectory: buildPath,
558+
editsDirectory: try editablesPath(),
559+
resolvedVersionsFilePath: try resolvedVersionsFilePath()
560+
),
559561
cachePath: cachePath,
560562
netrcFilePath: try netrcFilePath(),
561563
mirrors: self.getMirrorsConfig().mirrors,
@@ -638,7 +640,7 @@ public class SwiftTool {
638640
// The `plugins` directory is inside the workspace's main data directory, and contains all temporary
639641
// files related to all plugins in the workspace.
640642
let buildEnvironment = try buildParameters().buildEnvironment
641-
let dataDir = try self.getActiveWorkspace().dataPath
643+
let dataDir = try self.getActiveWorkspace().location.workingDirectory
642644
let pluginsDir = dataDir.appending(component: "plugins")
643645

644646
// The `cache` directory is in the plugins directory and is where the plugin script runner caches

Sources/SPMTestSupport/MockWorkspace.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,11 @@ public final class MockWorkspace {
158158

159159
let workspace = try Workspace(
160160
fileSystem: self.fs,
161-
dataPath: self.sandbox.appending(component: ".build"),
162-
editablesPath: self.sandbox.appending(component: "edits"),
163-
resolvedVersionsFilePath: self.sandbox.appending(component: "Package.resolved"),
161+
location: .init (
162+
workingDirectory: self.sandbox.appending(component: ".build"),
163+
editsDirectory: self.sandbox.appending(component: "edits"),
164+
resolvedVersionsFilePath: self.sandbox.appending(component: "Package.resolved")
165+
),
164166
cachePath: self.fs.swiftPMCacheDirectory,
165167
mirrors: self.config.mirrors,
166168
customToolsVersion: self.toolsVersion,

0 commit comments

Comments
 (0)