2014-12-02 29 views
0

因此,我正在關注該教程的appledoc生成(http://objcsharp.wordpress.com/2013/09/24/how-to-generate-beautiful-apple-style-documentation-in-xcode-5/)。構建後沒有任何反應。這裏的腳本:Appledoc無法在Xcode中運行

#if [ ${CONFIGURATION} == "Release" ]; then 
APPLEDOC_PATH=`which appledoc` 
if [ $APPLEDOC_PATH ]; then 
$APPLEDOC_PATH \ 
--project-name ${PRODUCT_NAME} \ 
--project-company "Your Name" \ 
--company-id "com.yourcompany" \ 
--output ${PRODUCT_NAME}Docs \ 
--keep-undocumented-objects \ 
--keep-undocumented-members \ 
--keep-intermediate-files \ 
--no-repeat-first-par \ 
--no-warn-invalid-crossref \ 
--exit-threshold 2 \ 
${PROJECT_DIR}/${PRODUCT_NAME} 
fi; 
#fi; 

爲了確保我正確安裝appledoc,我做了以下從終端和文檔顯示罰款。

appledoc --project-name BabelCPP --project-company "My Name" --company-id com.mycompany --no-create-docset --output ./doc/ ./CaterpillarCount/CaterpillarCount 

我是否在Xcode中缺少任何關鍵步驟或設置?它看起來像下面的部分沒有正確執行,它就是終止運行腳本:在OSX

APPLEDOC_PATH=`which appledoc` 
if [ $APPLEDOC_PATH ]; then 
$APPLEDOC_PATH \ 

回答

2

默認路徑爲/usr/bin:/bin:/usr/sbin:/sbin,如果你按照說明,你會它複製到/usr/local/bin

XCode不會考慮對.bash_profile文件等進行的更改,因此從它啓動的任何內容都不會有路徑(包括您發佈的運行腳本)。

您可以在APPLEDOC_PATH=...行之前的行上添加PATH=$PATH:/usr/local/bin,該行應該允許找到它。

其次,就需要有一個適當的試驗:

if [ -n "$APPLEDOC_PATH" -a -x "$APPLEDOC_PATH" ]; then 

即測試該變量被設置,並且該文件是可執行的,它確定。

所以,乾脆:

PATH=$PATH:/usr/local/bin 
APPLEDOC_PATH=`which appledoc` 
if [ -n "$APPLEDOC_PATH" -a -x "$APPLEDOC_PATH" ]; then 
+0

太感謝你了!它像一個魅力! – 2014-12-03 15:58:45