2
2
#
3
3
# This source file is part of the Swift.org open source project
4
4
#
5
- # Copyright (c) 2022 Apple Inc. and the Swift project authors
5
+ # Copyright (c) 2022-2023 Apple Inc. and the Swift project authors
6
6
# Licensed under Apache License v2.0 with Runtime Library Exception
7
7
#
8
8
# See https://swift.org/LICENSE.txt for license information
@@ -24,33 +24,10 @@ filepath() {
24
24
}
25
25
26
26
SWIFT_DOCC_SYMBOLKIT_ROOT=" $( dirname $( dirname $( filepath $0 ) ) ) "
27
- SYMBOL_GRAPH_OUTPUT_DIR=" $SWIFT_DOCC_SYMBOLKIT_ROOT /.build/swift-docc/symbol-graphs"
28
-
29
- mkdir -p " $SYMBOL_GRAPH_OUTPUT_DIR "
30
- rm -f " $SYMBOL_GRAPH_OUTPUT_DIR /*.*"
31
27
32
28
# Set current directory to the repository root
33
29
cd " $SWIFT_DOCC_SYMBOLKIT_ROOT "
34
30
35
- # On non-Darwin systems we expect the 'docc' command-line tool to be in the current path.
36
- # On Darwin, we expect 'docc' to be available via Xcode's 'xcrun'.
37
- DOCC_CMD=" "
38
- if command -v xcrun & > /dev/null
39
- then
40
- DOCC_CMD=" xcrun docc"
41
- elif command -v docc & > /dev/null
42
- then
43
- DOCC_CMD=" docc"
44
- else
45
- echo " Failed to find 'docc' or 'xcrun' in the current path."
46
- exit 1
47
- fi
48
-
49
- # Generate symbol graph files for SymbolKit
50
- swift build --target SymbolKit \
51
- -Xswiftc -emit-symbol-graph \
52
- -Xswiftc -emit-symbol-graph-dir -Xswiftc " $SYMBOL_GRAPH_OUTPUT_DIR "
53
-
54
31
# Use git worktree to checkout the gh-pages branch of this repository in a gh-pages sub-directory
55
32
git fetch
56
33
git worktree add --checkout gh-pages origin/gh-pages
@@ -60,13 +37,14 @@ export DOCC_JSON_PRETTYPRINT="YES"
60
37
61
38
# Generate documentation for the 'SymbolKit' target and output it
62
39
# to the /docs subdirectory in the gh-pages worktree directory.
63
- $DOCC_CMD convert " $SWIFT_DOCC_SYMBOLKIT_ROOT /Sources/SymbolKit/SymbolKit.docc" \
64
- --fallback-display-name SymbolKit \
65
- --fallback-bundle-identifier org.swift.SymbolKit \
66
- --fallback-bundle-version 1.0.0 \
40
+ swift package \
41
+ --package-path Documentation \
42
+ --allow-writing-to-directory " $SWIFT_DOCC_SYMBOLKIT_ROOT /gh-pages/docs" \
43
+ generate-documentation \
44
+ --target SymbolKit \
45
+ --disable-indexing \
67
46
--transform-for-static-hosting \
68
47
--hosting-base-path swift-docc-symbolkit \
69
- --additional-symbol-graph-dir " $SYMBOL_GRAPH_OUTPUT_DIR " \
70
48
--output-path " $SWIFT_DOCC_SYMBOLKIT_ROOT /gh-pages/docs"
71
49
72
50
# Save the current commit we've just built documentation from in a variable
0 commit comments