@@ -69,26 +69,24 @@ import PackagePlugin
69
69
customSymbolGraphOptions: parsedArguments. symbolGraphArguments
70
70
)
71
71
72
- if try FileManager . default. contentsOfDirectory ( atPath: symbolGraphs. targetSymbolGraphsDirectory. path) . isEmpty {
73
- // This target did not produce any symbol graphs. Let's check if it has a
74
- // DocC catalog.
72
+ if target. doccCatalogPath == nil ,
73
+ try FileManager . default. contentsOfDirectory ( atPath: symbolGraphs. targetSymbolGraphsDirectory. path) . isEmpty
74
+ {
75
+ // This target did not produce any symbol graphs and has no DocC catalog.
76
+ let message = """
77
+ ' \( target. name) ' does not contain any documentable symbols or a \
78
+ DocC catalog and will not produce documentation
79
+ """
75
80
76
- guard target. doccCatalogPath != nil else {
77
- let message = """
78
- ' \( target. name) ' does not contain any documentable symbols or a \
79
- DocC catalog and will not produce documentation
80
- """
81
-
82
- if swiftSourceModuleTargets. count > 1 {
83
- // We're building multiple targets, just throw a warning for this
84
- // one target that does not produce documentation.
85
- Diagnostics . warning ( message)
86
- } else {
87
- // This is the only target being built so throw an error
88
- Diagnostics . error ( message)
89
- }
90
- return
81
+ if swiftSourceModuleTargets. count > 1 {
82
+ // We're building multiple targets, just emit a warning for this
83
+ // one target that does not produce documentation.
84
+ Diagnostics . warning ( message)
85
+ } else {
86
+ // This is the only target being built so emit an error
87
+ Diagnostics . error ( message)
91
88
}
89
+ return
92
90
}
93
91
94
92
// Construct the output path for the generated DocC archive
0 commit comments