File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
swift_build_support/swift_build_support/products Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,10 @@ def _apply_default_arguments(args):
60
60
if args .build_linux_static and args .build_libcxx is None :
61
61
args .build_libcxx = True
62
62
63
+ # Previewing the stdlib docs requires building them.
64
+ if args .preview_stdlib_docs :
65
+ args .build_stdlib_docs = True
66
+
63
67
# Set the default CMake generator.
64
68
if args .cmake_generator is None :
65
69
args .cmake_generator = 'Ninja'
@@ -1163,7 +1167,11 @@ def create_argument_parser():
1163
1167
option ('--build-stdlib-docs' , toggle_true ,
1164
1168
default = False ,
1165
1169
help = 'Build documentation for the standard library.'
1166
- 'Note: this builds SwiftDocC to perform the docs build.' )
1170
+ 'Note: this builds Swift-DocC to perform the docs build.' )
1171
+ option ('--preview-stdlib-docs' , toggle_true ,
1172
+ default = False ,
1173
+ help = 'Build and preview standard library documentation with Swift-DocC.'
1174
+ 'Note: this builds Swift-DocC to perform the docs build.' )
1167
1175
1168
1176
option ('--build-swift-clang-overlays' , toggle_true ,
1169
1177
default = True ,
Original file line number Diff line number Diff line change @@ -45,9 +45,11 @@ def build(self, host_target):
45
45
symbol_graph_dir = os .path .join (swift_build_dir , "lib" , "symbol-graph" )
46
46
output_path = os .path .join (swift_build_dir , "Swift.doccarchive" )
47
47
48
+ docc_action = 'preview' if self .args .preview_stdlib_docs else 'convert'
49
+
48
50
docc_cmd = [
49
51
docc_path ,
50
- "convert" , # TODO: give people the option to preview instead
52
+ docc_action ,
51
53
"--additional-symbol-graph-dir" ,
52
54
symbol_graph_dir ,
53
55
"--output-path" ,
You can’t perform that action at this time.
0 commit comments