• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Javadoc-like feature in Xcode 4
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Javadoc-like feature in Xcode 4


  • Subject: Re: Javadoc-like feature in Xcode 4
  • From: Joshua Moody <email@hidden>
  • Date: Fri, 08 Apr 2011 21:24:52 +0100


On Apr 8, 2011, at 8:42 PM, Rick Mann wrote:


On Apr 8, 2011, at 3:12 , Joshua Moody wrote:

I use appledoc.  

Compared to doxygen, I find that it produces nicer looking documentation and is easier to configure.  I am using appledoc with Xcode 4 without any trouble.

http://www.gentlebytes.com/home/appledocapp/

Do you typically create a separate target for docs, or do you run it as part of your regular build?

At first glance, I didn't see any documentation on how to integrate it with my Xcode (3) builds.

I use a run script build phase in the target that contains the source code that I want to document.  I am using Xcode 4, but I have used a similar script in Xcode 3.

I've attached the script that I use.  This script is a work in progress.  Read the comments at the top of the script because I make several assumptions.  The default values for the variables assume that there is $SOURCE_ROOT/Documentation directory and that your appledoc templates and the appledoc binary exist in this directory.  In addition, because I want to generate both html and a docset, I pass --keep-intermediate-files to appledoc.  You may or may not want to do this.

jjm

Attachment: appledoc-script.sh
Description: Binary data


=== BEGIN SCRIPT ===

# This script uses appledoc to generate *.docsets that
# can viewed in Xcode and published to document feeds.
#
# It also generates nicely formated HTML documentation.
#
# By default the scripts assumes that there is a 
# Documentation directory at your project root (top level)
# directory and that this directory contains the following:
#
# 1. a templates directory with the appledoc templates in it
# 2. the appledoc executable
#
# Of course, appledoc can be installed anywhere - ditto for
# your templates.
#
# This script will only run if the build configuration
# ($BUILD_STYLE) is Release
#
# At the very minimum you MUST to change the values for
# 
# 1. AD_COMPANY 
# 2. AD_COMPANY_ID 
#
# and you'll probably want to change the AD_SOURCES
#
# The comment guide can be found here:
# http://tomaz.github.com/appledoc/comments.html
# and a settings guide can be found here:
# http://tomaz.github.com/appledoc/settings.html


# MUST CHANGE 
AD_COMPANY=

# MUST CHANGE (needs to be an reverse DNS id ex: com.littlejoysoftware"
AD_COMPANY_ID=


# see the script below for examples of how to define mulitple sources
AD_SOURCES="$SOURCE_ROOT"


# path to the Documentation directory (this must exist)
AD_DOC_DIRECTORY="$SOURCE_ROOT/Documentation"

# path to the templates directory (this must exist)
AD_TEMPLATES="$AD_DOC_DIRECTORY/templates"

# path to the appledoc executable (this must exist, although
# you can install appledocs where ever you want
APPLEDOC_PATH="$SOURCE_ROOT/Documentation/appledoc"

# the name of the project
AD_PROJECT_NAME="$PROJECT_NAME"

# where appledoc will build the documentation
# 
# the .docset is then moved (not copied) to --docset-install-path 
# which, if not specified, will be the default location 
# ~/Library/Developer/Shared/DocSets - this is where Xcode expects
# user generated doc sets to live
#
# --keep-intermediate-files _prevents_ the html directory from being deleted 
# from the --output directory - this usually what we want so we can publish
# docs as html
# 
# This directory will be created if it does not exist
AD_BUILD_DIRECTORY="$AD_DOC_DIRECTORY/$AD_PROJECT_NAME"

# queries the project plist to find the version number
# http://discussions.apple.com/thread.jspa?threadID=2125894
# http://discussions.apple.com/thread.jspa?threadID=2330135
# set this number yourself in the project plist
AD_VERSION_NUMBER=`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INFOPLIST_FILE"`

# range = (1, 3) - 1 is usually enough
AD_LOG_FORMAT=1

# range = (1, 6) - 3 is usually enough to see documentation errors, but it is slow
AD_VERBOSE=1

if [ $BUILD_STYLE = Release ] 
then
  if ! [ -d "$AD_DOC_DIRECTORY" ]
  then 
    echo No directory found at "$AD_DOC_DIRECTORY" - this directory must exist
    exit 1
  fi

  if ! [ -d "$AD_TEMPLATES" ]
  then
    echo No templates directory found at "$AD_TEMPLATES" - this directory must exist and contain the appledoc templates
    exit 1
    fi

 

  if ! [ -f "$APPLEDOC_PATH" ]
  then
    echo No application found at $APPLEDOC_PATH
    echo install binary from http://www.gentlebytes.com/home/appledocapp/
    exit 1
  fi

  

  if ! [ -d "$AD_BUILD_DIRECTORY" ]
  then
    echo Did not find the build directory at "$AD_BUILD_DIRECTORY" - making it
    mkdir "$AD_BUILD_DIRECTORY"
  fi


  $APPLEDOC_PATH --output "$AD_BUILD_DIRECTORY" --templates "$AD_TEMPLATES" --project-name "$AD_PROJECT_NAME" \
--project-version "$AD_PROJECT_VERSION" --project-company "$AD_COMPANY" --company-id "$AD_COMPANY_ID" \
--create-html --create-docset --logformat "$AD_LOG_FORMAT" --verbose "$AD_VERBOSE" --keep-intermediate-files \
"$SOURCE_ROOT"


# multiple source directories can be configured as follows
# "$SOURCE_ROOT/MAMFramework/Utilities" \
# "$SOURCE_ROOT/MAMFramework/PlugIn Abstract Classes" \
# "$SOURCE_ROOT/MAMFramework/MAM Model Classes" \
# "$SOURCE_ROOT/MAMFramework/Error" \
# "$SOURCE_ROOT/LJSExampleRealTimeTimer" \
# "$SOURCE_ROOT/LJSExampleSystemTimeTimer" \
# "$SOURCE_ROOT/MamTimerTester" 

# no sense in doing this - global/extern variables are not captured
#"$SOURCE_ROOT/MAMFramework/MamFramework.h" \
#"$SOURCE_ROOT/MAMFramework/MamFrameworkGlobals.h"

  EXIT_CODE=`echo $?`
  echo Exiting with code: $EXIT_CODE
  exit $EXIT_CODE
fi

=== END SCRIPT ===

Joshua Moody

email: email@hidden

iChat:  email@hidden
Skype:  morethan50eggs

http://littlejoysoftware.com/

US:   +1 802  659 0087
UK:  +44  20 3286 1473











 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Javadoc-like feature in Xcode 4
      • From: Rick Mann <email@hidden>
References: 
 >Javadoc-like feature in Xcode 4 (From: qvacua <email@hidden>)
 >Re: Javadoc-like feature in Xcode 4 (From: Eric Wing <email@hidden>)
 >Re: Javadoc-like feature in Xcode 4 (From: Joshua Moody <email@hidden>)
 >Re: Javadoc-like feature in Xcode 4 (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Javadoc-like feature in Xcode 4
  • Next by Date: Re: Javadoc-like feature in Xcode 4
  • Previous by thread: Re: Javadoc-like feature in Xcode 4
  • Next by thread: Re: Javadoc-like feature in Xcode 4
  • Index(es):
    • Date
    • Thread