You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make the symbol graph extraction requested by plugins more robust (#3993)
* Rework the SymbolGraphExtract so it's more suitable for being called in the context of plugins.
This includes parameterizing the output format and the output path, as well as the diagnostics that are printed, and applying the extractor to a target at a time and not always to all the targets in a package. The original behavior for the `dump-symbol-graph` command is unmodified, but some of the specifics are hoisted into the DumpSymbolGraph command implementation rather than in the reusable SymbolGraphExtract type.
* Make the symbol graph generation more robust by using the refactored SymbolGraphExtract:
- only generate symbol graph information for the specified target
- use a unique symbol graph output directory for each package/target combination
- added a unit test to check these things.
* Skip the test in a bootstrap situation where we're using a Swift compiler that hasn't built the `swift-symbolgraph-extract` tool. There is a `SWIFT_SYMBOLGRAPH_EXTRACT` env var that could be used to point it another binary, but on platforms other than macOS we don't have an existing Xcode or anything that would be guaranteed to contain this tool. This test should still run on full builds and on self tests, where the tool is available.
rdar://87234110&86785765
@Flag(help:"Skip members inherited through classes or default implementations.")
543
543
varskipSynthesizedMembers=false
544
544
545
-
@Option(help:"Include symbols with this access level or more. Possible values: \(AccessLevel.allValueStrings.joined(separator:" | "))")
545
+
@Option(help:"Include symbols with this access level or more. Possible values: \(SymbolGraphExtract.AccessLevel.allValueStrings.joined(separator:" | "))")
546
546
varminimumAccessLevel= defaultMinimumAccessLevel
547
547
548
548
@Flag(help:"Skip emitting doc comments for members inherited through classes or default implementations.")
// The cases reflect those found in `include/swift/AST/AttrKind.h` of the swift compiler (at commit 03f55d7bb4204ca54841218eb7cc175ae798e3bd)
33
+
case `private`, `fileprivate`, `internal`, `public`, `open`
30
34
}
31
35
32
-
publicfunc dumpSymbolGraph(
36
+
/// Output format of the generated symbol graph.
37
+
publicenumOutputFormat{
38
+
/// JSON format, optionally "pretty-printed" be more human-readable.
39
+
case json(pretty:Bool)
40
+
}
41
+
42
+
/// Creates a symbol graph for `target` in `outputDirectory` using the build information from `buildPlan`. The `outputDirection` determines how the output from the tool subprocess is handled, and `verbosity` specifies how much console output to ask the tool to emit.
0 commit comments