Skip to content

Commit d162551

Browse files
erwinmazaaciidgh
authored andcommitted
SR-6277 "WIP" Mute non-JSON output from "dump-package" (#1599)
* SR-6277 "WIP" Mute non-json output from dump-package Submitting PR for feedback on the solution, in advance of writing unit tests. This PR mutes tool progress output by default. It also introduces a new dump-package option: ` --include-tool-output` to override this default and show dependency resolution and fetch progress as before. Diagnostics that contain an error are still printed to the console. I am seeking feedback on this solution as I an new to this codebase and unfamiliar with it's broader structure, and expectations regarding tool putput handling. * Revert "SR-6277 "WIP" Mute non-json output from dump-package" This reverts commit c560fe1. * Load manifest instead of loading package graph
1 parent 228f1b0 commit d162551

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Sources/Commands/SwiftPackageTool.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,10 @@ public class SwiftPackageTool: SwiftTool<PackageToolOptions> {
186186
describe(graph.rootPackages[0].underlyingPackage, in: options.describeMode, on: stdoutStream)
187187

188188
case .dumpPackage:
189-
let graph = try loadPackageGraph()
190-
let manifest = graph.rootPackages[0].manifest
191-
print(try manifest.jsonString())
189+
let workspace = try getActiveWorkspace()
190+
let root = try getWorkspaceRoot()
191+
let manifests = workspace.loadRootManifests(packages: root.packages, diagnostics: diagnostics)
192+
print(try manifests[0].jsonString())
192193

193194
case .completionTool:
194195
switch options.completionToolMode {

0 commit comments

Comments
 (0)