@@ -78,7 +78,7 @@ final public class DocumentationCompilerSpec: GenericCompilerSpec, SpecIdentifie
78
78
var additionalFlags = [ String] ( )
79
79
80
80
// 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) {
82
82
additionalFlags. append ( " -symbol-graph-pretty-print " )
83
83
}
84
84
@@ -88,19 +88,34 @@ final public class DocumentationCompilerSpec: GenericCompilerSpec, SpecIdentifie
88
88
}
89
89
90
90
// 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) {
92
92
additionalFlags. append ( " -symbol-graph-skip-synthesized-members " )
93
93
}
94
94
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 " ] )
104
119
}
105
120
}
106
121
0 commit comments