Created
July 12, 2011 09:20
-
-
Save sumchattering/1077672 to your computer and use it in GitHub Desktop.
Script to be used within xcode as a build phase to generate documentation with appledoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Script to be used within xcode as a build phase to generate documentation with appledoc | |
# Prior to the execution of this script the appledoc executable and templates should have been copied | |
# to folder appledoc in the project root directory | |
# | |
# Created by Sumeru Chatterjee when he woke up till 7 AM on July 12 2011 | |
#Path to Appledoc executable | |
APPLEDOC="$PROJECT_DIR"/appledoc/appledoc | |
echo "Checking For Appledoc Executable at ${APPLEDOC}" | |
if [[ ! `ls "${APPLEDOC}"` ]] | |
then | |
exit -1 | |
fi | |
#The Templates Directory | |
TEMPLATE_DIR="$PROJECT_DIR"/appledoc/Templates | |
#The Output Directory | |
OUTPUT_DIR="$PROJECT_DIR"/appledoc/Output | |
#The Headers Directory where the headers have been copied in the previous build phase | |
HEADER_DIR="$PROJECT_DIR"/appledoc/Output | |
#Company Name | |
COMPANY=MicroStrategy | |
#Project Name | |
PROJECT=Alert | |
#Company ID | |
COMPANY_ID=com.microstrategy | |
echo "Running appledoc to Generate Documentation From Header Files" | |
"${APPLEDOC}" --templates ${TEMPLATE_DIR} --project-name ${PROJECT} --project-company ${COMPANY} --company-id ${COMPANY_ID} --output ${OUTPUT_DIR} --keep-intermediate-files --keep-undocumented-objects --keep-undocumented-members --search-undocumented-doc --merge-categories ${HEADER_DIR} | |
#The address of the Web Server root on a mac | |
WEB_SERVER_ROOT=/Library/WebServer/Documents | |
echo "Removing Previous Documentation from ${WEB_SERVER_ROOT}/alertdoc" | |
rm -rf $WEB_SERVER_ROOT/alertdoc/* | |
echo "Copying Generated HTML to ${WEB_SERVER_ROOT}/alertdoc" | |
cp -R "$PROJECT_DIR"/appledoc/output/html/* $WEB_SERVER_ROOT/alertdoc | |
if [ $? -eq 0 ] ; then | |
echo "Files Copied Successfully.Now go to http://127.0.0.1/alertdoc to view the documentation" | |
exit 0; | |
else | |
echo "ERROR: failed to copy files to webserver directory" | |
exit -1; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment