Skip to content

Instantly share code, notes, and snippets.

@sumchattering
Created July 12, 2011 09:20

Revisions

  1. Sumeru Chatterjee revised this gist Jul 28, 2011. 1 changed file with 18 additions and 15 deletions.
    33 changes: 18 additions & 15 deletions appledocgen.sh
    Original file line number Diff line number Diff line change
    @@ -3,14 +3,17 @@
    # Prior to the execution of this script the appledoc executable and templates should have been copied
    # to the appledoc folder in the project root directory
    #
    # Created by Sumeru Chatterjee the night the earth stood still
    # Created by Sumeru Chatterjee when he was awake till 7 AM on July 12 2011
    # https://gist.github.com/1077672

    #Company Name the only variable that I cant seem to grab from the environment_variables
    COMPANY=My_Company_Name

    #path to the appledoc directory
    DOC_DIR="$PROJECT_DIR"/appledoc

    #Path to Appledoc executable
    APPLEDOC="$PROJECT_DIR"/appledoc/appledoc
    APPLEDOC="$DOC_DIR"/appledoc

    echo "Checking For Appledoc Executable at ${APPLEDOC}"

    @@ -20,41 +23,41 @@ exit -1
    fi

    #The Templates Directory
    TEMPLATE_DIR="$PROJECT_DIR"/appledoc/Templates
    TEMPLATE_DIR="$DOC_DIR"/Templates

    #The Output Directory
    OUTPUT_DIR="$PROJECT_DIR"/appledoc/Output
    OUTPUT_DIR="$DOC_DIR"/Output

    #Company ID
    COMPANY_SMALL=`echo $COMPANY | tr A-Z a-z`
    COMPANY_ID="com.${COMPANY_SMALL}"

    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 --logformat xcode "$PROJECT_DIR"/appledoc/Headers
    "${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 --logformat xcode "$DOC_DIR"/Headers

    #Delete Copied Headers
    rm "$PROJECT_DIR"/appledoc/Headers/*
    rm "$DOC_DIR"/Headers/*

    #The address of the Web Server root on a mac
    WEB_SERVER_ROOT=/Library/WebServer/Documents
    PROJECT_SMALL=`echo $PROJECT | tr A-Z a-z`
    DOC_DIR="${PROJECT_SMALL}doc"
    WEBDOC_DIR_NAME="${PROJECT_SMALL}doc"

    if [ ! -d "$WEB_SERVER_ROOT/$DOC_DIR" ]; then
    echo "Creating Directory ${WEB_SERVER_ROOT}/${DOC_DIR}"
    mkdir $WEB_SERVER_ROOT/$DOC_DIR
    if [ ! -d "$WEB_SERVER_ROOT/$WEBDOC_DIR" ]; then
    echo "Creating Directory ${WEB_SERVER_ROOT}/${WEBDOC_DIR_NAME}"
    mkdir $WEB_SERVER_ROOT/$WEBDOC_DIR_NAME
    else
    echo "Cleaning Previous Documentation from ${WEB_SERVER_ROOT}/${DOC_DIR}"
    rm -rf $WEB_SERVER_ROOT/$DOC_DIR/*
    echo "Cleaning Previous Documentation from ${WEB_SERVER_ROOT}/${WEBDOC_DIR_NAME}"
    rm -rf $WEB_SERVER_ROOT/$WEBDOC_DIR_NAME/*
    fi

    echo "Copying Generated HTML to ${WEB_SERVER_ROOT}/${DOC_DIR}"
    echo "Copying Generated HTML to ${WEB_SERVER_ROOT}/${WEBDOC_DIR_NAME}"

    cp -R "$PROJECT_DIR"/appledoc/output/html/* $WEB_SERVER_ROOT/$DOC_DIR
    cp -R "$DOC_DIR"/output/html/* $WEB_SERVER_ROOT/$WEBDOC_DIR_NAME

    if [ $? -eq 0 ] ; then
    echo "Files Copied Successfully.Now go to http://127.0.0.1/${DOC_DIR} to view the documentation"
    echo "Files Copied Successfully.Now go to http://127.0.0.1/${WEBDOC_DIR_NAME} to view the documentation"
    exit 0;
    else
    echo "ERROR: failed to copy files to webserver directory"
  2. Sumeru Chatterjee revised this gist Jul 14, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion appledocgen.sh
    Original file line number Diff line number Diff line change
    @@ -31,7 +31,7 @@ COMPANY_ID="com.${COMPANY_SMALL}"

    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 "$PROJECT_DIR"/appledoc/Headers
    "${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 --logformat xcode "$PROJECT_DIR"/appledoc/Headers

    #Delete Copied Headers
    rm "$PROJECT_DIR"/appledoc/Headers/*
  3. Sumeru Chatterjee revised this gist Jul 12, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions appledocgen.sh
    Original file line number Diff line number Diff line change
    @@ -3,11 +3,11 @@
    # Prior to the execution of this script the appledoc executable and templates should have been copied
    # to the appledoc folder in the project root directory
    #
    # Created by Sumeru Chatterjee when he was awake till 7 AM on July 12 2011
    # Created by Sumeru Chatterjee the night the earth stood still
    # https://gist.github.com/1077672

    #Company Name the only variable that I cant seem to grab from the environment_variables
    COMPANY=MicroStrategy
    COMPANY=My_Company_Name

    #Path to Appledoc executable
    APPLEDOC="$PROJECT_DIR"/appledoc/appledoc
  4. Sumeru Chatterjee revised this gist Jul 12, 2011. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions appledocgen.sh
    Original file line number Diff line number Diff line change
    @@ -33,6 +33,9 @@ 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 "$PROJECT_DIR"/appledoc/Headers

    #Delete Copied Headers
    rm "$PROJECT_DIR"/appledoc/Headers/*

    #The address of the Web Server root on a mac
    WEB_SERVER_ROOT=/Library/WebServer/Documents
    PROJECT_SMALL=`echo $PROJECT | tr A-Z a-z`
  5. Sumeru Chatterjee revised this gist Jul 12, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions appledocgen.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/bin/sh
    # Script to be used within xcode to generate documentation through xcode
    # prior to this the appledoc executable and templates should have been copied
    # Script to be used within xcode to generate documentation through appledoc
    # Prior to the execution of this script the appledoc executable and templates should have been copied
    # to the appledoc folder in the project root directory
    #
    # Created by Sumeru Chatterjee when he was awake till 7 AM on July 12 2011
  6. Sumeru Chatterjee revised this gist Jul 12, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion appledocgen.sh
    Original file line number Diff line number Diff line change
    @@ -38,7 +38,7 @@ WEB_SERVER_ROOT=/Library/WebServer/Documents
    PROJECT_SMALL=`echo $PROJECT | tr A-Z a-z`
    DOC_DIR="${PROJECT_SMALL}doc"

    if [ ! -d "$WEB_SERVER_ROOT/alertdoc" ]; then
    if [ ! -d "$WEB_SERVER_ROOT/$DOC_DIR" ]; then
    echo "Creating Directory ${WEB_SERVER_ROOT}/${DOC_DIR}"
    mkdir $WEB_SERVER_ROOT/$DOC_DIR
    else
  7. Sumeru Chatterjee revised this gist Jul 12, 2011. 1 changed file with 16 additions and 15 deletions.
    31 changes: 16 additions & 15 deletions appledocgen.sh
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,11 @@
    # prior to this the appledoc executable and templates should have been copied
    # to the appledoc folder in the project root directory
    #
    # Created by Sumeru Chatterjee when he woke up till 7 AM on July 12 2011
    # Created by Sumeru Chatterjee when he was awake till 7 AM on July 12 2011
    # https://gist.github.com/1077672

    #Company Name the only variable that I cant seem to grab from the environment_variables
    COMPANY=MicroStrategy

    #Path to Appledoc executable
    APPLEDOC="$PROJECT_DIR"/appledoc/appledoc
    @@ -21,36 +25,33 @@ TEMPLATE_DIR="$PROJECT_DIR"/appledoc/Templates
    #The Output Directory
    OUTPUT_DIR="$PROJECT_DIR"/appledoc/Output

    #Company Name
    COMPANY=MicroStrategy

    #Project Name
    PROJECT=Alert

    #Company ID
    COMPANY_ID=com.microstrategy
    COMPANY_SMALL=`echo $COMPANY | tr A-Z a-z`
    COMPANY_ID="com.${COMPANY_SMALL}"

    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 "$PROJECT_DIR"/appledoc/Headers

    #The address of the Web Server root on a mac
    WEB_SERVER_ROOT=/Library/WebServer/Documents
    PROJECT_SMALL=`echo $PROJECT | tr A-Z a-z`
    DOC_DIR="${PROJECT_SMALL}doc"

    if [ ! -d "$WEB_SERVER_ROOT/alertdoc" ]; then
    echo "Creating Directory ${WEB_SERVER_ROOT}/alertdoc"
    mkdir ${WEB_SERVER_ROOT}/alertdoc
    echo "Creating Directory ${WEB_SERVER_ROOT}/${DOC_DIR}"
    mkdir $WEB_SERVER_ROOT/$DOC_DIR
    else
    echo "Cleaning Previous Documentation from ${WEB_SERVER_ROOT}/alertdoc"
    rm -rf $WEB_SERVER_ROOT/alertdoc/*
    echo "Cleaning Previous Documentation from ${WEB_SERVER_ROOT}/${DOC_DIR}"
    rm -rf $WEB_SERVER_ROOT/$DOC_DIR/*
    fi

    echo "Copying Generated HTML to ${WEB_SERVER_ROOT}/alertdoc"
    echo "Copying Generated HTML to ${WEB_SERVER_ROOT}/${DOC_DIR}"

    cp -R "$PROJECT_DIR"/appledoc/output/html/* $WEB_SERVER_ROOT/alertdoc
    cp -R "$PROJECT_DIR"/appledoc/output/html/* $WEB_SERVER_ROOT/$DOC_DIR

    if [ $? -eq 0 ] ; then
    echo "Files Copied Successfully.Now go to http://127.0.0.1/alertdoc to view the documentation"
    echo "Files Copied Successfully.Now go to http://127.0.0.1/${DOC_DIR} to view the documentation"
    exit 0;
    else
    echo "ERROR: failed to copy files to webserver directory"
  8. Sumeru Chatterjee revised this gist Jul 12, 2011. No changes.
  9. Sumeru Chatterjee renamed this gist Jul 12, 2011. 1 changed file with 11 additions and 10 deletions.
    21 changes: 11 additions & 10 deletions applegen.sh → appledocgen.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/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
    # Script to be used within xcode to generate documentation through xcode
    # prior to this the appledoc executable and templates should have been copied
    # to the appledoc folder in the project root directory
    #
    # Created by Sumeru Chatterjee when he woke up till 7 AM on July 12 2011

    @@ -21,9 +21,6 @@ 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

    @@ -35,14 +32,18 @@ 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}
    "${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 "$PROJECT_DIR"/appledoc/Headers

    #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/*
    if [ ! -d "$WEB_SERVER_ROOT/alertdoc" ]; then
    echo "Creating Directory ${WEB_SERVER_ROOT}/alertdoc"
    mkdir ${WEB_SERVER_ROOT}/alertdoc
    else
    echo "Cleaning Previous Documentation from ${WEB_SERVER_ROOT}/alertdoc"
    rm -rf $WEB_SERVER_ROOT/alertdoc/*
    fi

    echo "Copying Generated HTML to ${WEB_SERVER_ROOT}/alertdoc"

  10. Sumeru Chatterjee created this gist Jul 12, 2011.
    57 changes: 57 additions & 0 deletions applegen.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,57 @@
    #!/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