@@ -78,7 +78,7 @@ final public class DocumentationCompilerSpec: GenericCompilerSpec, SpecIdentifie
7878 var additionalFlags = [ String] ( )
7979
8080 // Check if pretty print is requested
81- if cbc. scope. evaluate ( BuiltinMacros . DOCC_PRETTY_PRINT) && swiftCompilerInfo . toolFeatures . has ( . emitExtensionBlockSymbols ) {
81+ if cbc. scope. evaluate ( BuiltinMacros . DOCC_PRETTY_PRINT) {
8282 additionalFlags. append ( " -symbol-graph-pretty-print " )
8383 }
8484
@@ -88,19 +88,34 @@ final public class DocumentationCompilerSpec: GenericCompilerSpec, SpecIdentifie
8888 }
8989
9090 // Check if synthesized members should be skipped
91- if cbc. scope. evaluate ( BuiltinMacros . DOCC_SKIP_SYNTHESIZED_MEMBERS) && swiftCompilerInfo . toolFeatures . has ( . emitExtensionBlockSymbols ) {
91+ if cbc. scope. evaluate ( BuiltinMacros . DOCC_SKIP_SYNTHESIZED_MEMBERS) {
9292 additionalFlags. append ( " -symbol-graph-skip-synthesized-members " )
9393 }
9494
95- switch DocumentationType ( from: cbc) {
96- case . executable:
97- // When building executable types (like applications and command-line tools), include
98- // internal symbols in the generated symbol graph.
99- return additionalFlags. appending ( contentsOf: [ " -symbol-graph-minimum-access-level " , " internal " ] )
100- case . framework, . none:
101- // For frameworks (and non-documentable types), just use the default behavior
102- // of the symbol graph tool.
103- return additionalFlags
95+ switch cbc. scope. evaluate ( BuiltinMacros . DOCC_MINIMUM_ACCESS_LEVEL) {
96+ case . none:
97+ switch DocumentationType ( from: cbc) {
98+ case . executable:
99+ // When building executable types (like applications and command-line tools), include
100+ // internal symbols in the generated symbol graph.
101+ return additionalFlags. appending ( contentsOf: [ " -symbol-graph-minimum-access-level " , " internal " ] )
102+ case . framework, . none:
103+ // For frameworks (and non-documentable types), just use the default behavior
104+ // of the symbol graph tool.
105+ return additionalFlags
106+ }
107+ case . private:
108+ return additionalFlags. appending ( contentsOf: [ " symbol-graph-minimum-access-level " , " private " ] )
109+ case . fileprivate:
110+ return additionalFlags. appending ( contentsOf: [ " symbol-graph-minimum-access-level " , " fileprivate " ] )
111+ case . internal:
112+ return additionalFlags. appending ( contentsOf: [ " symbol-graph-minimum-access-level " , " internal " ] )
113+ case . package :
114+ return additionalFlags. appending ( contentsOf: [ " symbol-graph-minimum-access-level " , " package " ] )
115+ case . public:
116+ return additionalFlags. appending ( contentsOf: [ " symbol-graph-minimum-access-level " , " public " ] )
117+ case . open:
118+ return additionalFlags. appending ( contentsOf: [ " symbol-graph-minimum-access-level " , " open " ] )
104119 }
105120 }
106121
0 commit comments