Skip to content

Commit

Permalink
Update build-documentation.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
leoho0722 committed Oct 2, 2023
1 parent 115cfd9 commit 20dd65a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 47 deletions.
34 changes: 3 additions & 31 deletions build-documentation.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,5 @@
#!/bin/bash

# 用來檢查是否有產生 Swift-DocC Documentation 路徑
isDirectoryExist=false

# 檢查是否有產生 Swift-DocC Documentation,有的話將 isDirectoryExist 設為 true,沒有的話,則設為 false
test -d ./.build/plugins/Swift-DocC/outputs && isDirectoryExist=true || isDirectoryExist=false

echo $isDirectoryExist

# 如果 Swift-DocC Documentation 路徑存在的話,則將原先 ./.build 資料夾移除
if [ isDirectoryExist ]; then
rm -rf ./.build
fi

swift package generate-documentation --include-extended-types

# 用來檢查專案根目錄底下,是否已存在 Documentation 資料夾
isDocumentationFolderExist=false

# 檢查是否有產生 Documentation 資料夾,有的話將 isDocumentationExist 設為 true,沒有的話,則設為 false
test -d ./Documentation && isDocumentationFolderExist=true || isDocumentationFolderExist=false

echo $isDocumentationFolderExist

pwd

# 如果 Documentation 資料夾不存在的話,則在專案根目錄底下建立
if [ $isDocumentationFolderExist == false ]; then
mkdir ./Documentation
fi

cp -r ./.build/plugins/Swift-DocC/outputs/ ./Documentation
xcodebuild docbuild -scheme SwiftHelpers-Package \
-destination generic/platform=iOS \
OTHER_DOCC_FLAGS="--transform-for-static-hosting --hosting-base-path SwiftHelpers-Package"
16 changes: 0 additions & 16 deletions convert-doccarchive.sh

This file was deleted.

0 comments on commit 20dd65a

Please sign in to comment.