Skip to content

Commit 60a0765

Browse files
committed
chore: update doc script
1 parent 8709778 commit 60a0765

File tree

1 file changed

+15
-28
lines changed

1 file changed

+15
-28
lines changed

scripts/build-docs.sh

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,36 +31,23 @@ build_for_platform() {
3131
OTHER_SWIFT_FLAGS="-Xfrontend -emit-symbol-graph -Xfrontend -emit-symbol-graph-dir -Xfrontend ${LOC_SYMBOL_GRAPHS_DIR} -Xfrontend -emit-extension-block-symbols" | xcbeautify
3232
}
3333

34-
build_for_ios() {
35-
echo "📱 Building for iOS"
36-
build_for_platform ${SYMBOL_GRAPHS_DIR_IOS} ${DERIVED_DATA_DIR} "generic/platform=iOS"
37-
}
38-
39-
build_for_watchos() {
40-
echo "⌚ Building for watchOS"
41-
build_for_platform ${SYMBOL_GRAPHS_DIR_WATCHOS} ${DERIVED_DATA_DIR} "generic/platform=watchOS"
42-
}
43-
44-
build_for_visionos() {
45-
echo "🕶️ Building for visionOS"
46-
build_for_platform ${SYMBOL_GRAPHS_DIR_VISIONOS} ${DERIVED_DATA_DIR} "generic/platform=visionOS"
47-
}
48-
49-
build_for_tvos() {
50-
echo "📺 Building for tvOS"
51-
build_for_platform ${SYMBOL_GRAPHS_DIR_TVOS} ${DERIVED_DATA_DIR} "generic/platform=tvOS"
52-
}
34+
platforms=(
35+
iOS,"📱","${SYMBOL_GRAPHS_DIR_IOS}"
36+
watchOS,"","${SYMBOL_GRAPHS_DIR_WATCHOS}"
37+
visionOS,"🕶️","${SYMBOL_GRAPHS_DIR_VISIONOS}"
38+
tvOS,"📺","${SYMBOL_GRAPHS_DIR_TVOS}"
39+
macOS,"💻","${SYMBOL_GRAPHS_DIR_MACOS}"
40+
)
5341

54-
build_for_macos() {
55-
echo "💻 Building for macOS"
56-
build_for_platform ${SYMBOL_GRAPHS_DIR_MACOS} ${DERIVED_DATA_DIR} "generic/platform=macOS"
57-
}
42+
# Iterate over available platforms
43+
for input in "${platforms[@]}"; do
44+
# Split elements
45+
IFS=","
46+
set -- $input
5847

59-
build_for_ios
60-
build_for_watchos
61-
build_for_visionos
62-
build_for_tvos
63-
build_for_macos
48+
echo "$2 Building for $1"
49+
build_for_platform "$3" ${DERIVED_DATA_DIR} "generic/platform=$1"
50+
done
6451

6552
# Create a .doccarchive from the symbols.
6653
$(xcrun --find docc) convert "${DOCC_BUNDLE_PATH}" \

0 commit comments

Comments
 (0)