File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,8 +73,21 @@ mkdir -p "$DOCBUILD_DIR"
7373
7474# Build documentation using xcodebuild docbuild
7575echo " Building documentation with xcodebuild..."
76- # For Swift packages, we need to use -packagePath instead of -scheme
76+ # First, generate an Xcode project if it doesn't exist
77+ if [ ! -f " $REPO_ROOT /${PACKAGE_NAME} .xcodeproj/project.pbxproj" ]; then
78+ echo " Generating Xcode project..."
79+ cd " $REPO_ROOT "
80+ swift package generate-xcodeproj 2> /dev/null || {
81+ echo " Note: generate-xcodeproj may not be available, trying direct build..."
82+ }
83+ fi
84+
85+ # Build documentation - try with scheme first, then with package
7786if xcodebuild docbuild \
87+ -scheme " $PACKAGE_NAME " \
88+ -derivedDataPath " $DOCBUILD_DIR " \
89+ -destination ' generic/platform=macOS' 2>&1 || \
90+ xcodebuild docbuild \
7891 -packagePath " $REPO_ROOT " \
7992 -derivedDataPath " $DOCBUILD_DIR " \
8093 -destination ' generic/platform=macOS' 2>&1 ; then
You can’t perform that action at this time.
0 commit comments