36 lines
924 B
Bash
36 lines
924 B
Bash
|
|
#!/bin/bash
|
|
|
|
# Define your scheme and output path
|
|
SCHEME="VDS"
|
|
OUTPUT_PATH="/Users/mattbruce/Desktop/VDSDocs"
|
|
HOSTING_BASE_PATH="/"
|
|
|
|
# Generate the DocC archive
|
|
echo "Generating the DocC archive..."
|
|
xcodebuild docbuild \
|
|
-scheme $SCHEME \
|
|
-destination 'generic/platform=iOS' \
|
|
-derivedDataPath ./.build
|
|
|
|
# Find the path to the DocC archive
|
|
ARCHIVE_PATH=$(find ./.build -name "*.doccarchive" -print -quit)
|
|
|
|
if [ -z "$ARCHIVE_PATH" ]; then
|
|
echo "DocC archive not found. Exiting..."
|
|
exit 1
|
|
fi
|
|
|
|
echo "Archive found at $ARCHIVE_PATH"
|
|
|
|
# Convert the archive to static hosting with the correct base path
|
|
echo "Converting the DocC archive to static hosting format..."
|
|
xcrun docc convert $ARCHIVE_PATH --output-path $OUTPUT_PATH --hosting-base-path $HOSTING_BASE_PATH
|
|
|
|
# Archive the documentation for upload
|
|
echo "Archiving the documentation..."
|
|
zip -r docs.zip $OUTPUT_PATH
|
|
|
|
echo "Archive docs.zip is ready for upload."
|
|
|