Skip to content

Commit 0ee49b6

Browse files
committed
Remove custom documentation generate script
1 parent 1a184ae commit 0ee49b6

File tree

3 files changed

+35
-30
lines changed

3 files changed

+35
-30
lines changed

Documentation/Empty/Empty.swift

Whitespace-only changes.

Documentation/Package.swift

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// swift-tools-version:5.6
2+
/*
3+
This source file is part of the Swift.org open source project
4+
Copyright (c) 2023 Apple Inc. and the Swift project authors
5+
Licensed under Apache License v2.0 with Runtime Library Exception
6+
See https://swift.org/LICENSE.txt for license information
7+
See https://swift.org/CONTRIBUTORS.txt for Swift project authors
8+
*/
9+
10+
import PackageDescription
11+
12+
let package = Package(
13+
name: "Documentation",
14+
dependencies: [
15+
.package(name: "SymbolKit", path: "../."),
16+
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0"),
17+
],
18+
targets: [
19+
.target(
20+
name: "Empty",
21+
dependencies: [
22+
.product(name: "SymbolKit", package: "SymbolKit"),
23+
],
24+
path: "Empty"
25+
)
26+
]
27+
)

bin/update-gh-pages-documentation-site

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# This source file is part of the Swift.org open source project
44
#
5-
# Copyright (c) 2022 Apple Inc. and the Swift project authors
5+
# Copyright (c) 2022-2023 Apple Inc. and the Swift project authors
66
# Licensed under Apache License v2.0 with Runtime Library Exception
77
#
88
# See https://swift.org/LICENSE.txt for license information
@@ -24,33 +24,10 @@ filepath() {
2424
}
2525

2626
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/*.*"
3127

3228
# Set current directory to the repository root
3329
cd "$SWIFT_DOCC_SYMBOLKIT_ROOT"
3430

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-
5431
# Use git worktree to checkout the gh-pages branch of this repository in a gh-pages sub-directory
5532
git fetch
5633
git worktree add --checkout gh-pages origin/gh-pages
@@ -60,13 +37,14 @@ export DOCC_JSON_PRETTYPRINT="YES"
6037

6138
# Generate documentation for the 'SymbolKit' target and output it
6239
# 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 \
6746
--transform-for-static-hosting \
6847
--hosting-base-path swift-docc-symbolkit \
69-
--additional-symbol-graph-dir "$SYMBOL_GRAPH_OUTPUT_DIR" \
7048
--output-path "$SWIFT_DOCC_SYMBOLKIT_ROOT/gh-pages/docs"
7149

7250
# Save the current commit we've just built documentation from in a variable
@@ -87,4 +65,4 @@ fi
8765

8866
# Delete the git worktree we created
8967
cd ..
90-
git worktree remove gh-pages
68+
git worktree remove gh-pages

0 commit comments

Comments
 (0)