#!/bin/bash # specify the Xcode installation directory xcode_path=/Developer # specify the output archive file name archive_name=xal-docset.xar # specify the location of the original javadoc javadoc_path=../main/build/javadoc # specify the docset bundle doc_bundle=gov.sns.XAL.docset # construct the location to store the documents within the doc bundle doc_path=${doc_bundle}/Contents/Resources/Documents # change directory to the location of this script base_dir=${0%/*} echo "change directory to: $base_dir" cd $base_dir # copy the javadoc into the docset echo "copying the javadoc from the project into the docset ..." rsync -av --delete ${javadoc_path} ${doc_path} # cleanup index-all.html to remove offending text echo "cleaning index-all.html ..." sed '//,/<\/HEAD>/d' ${doc_path}/javadoc/index-all.html > clean.html # generate (from the clean HTML) and install a Tokens.xml file into the docset echo "generating Tokens.xml ..." xsltproc --html -o ${doc_bundle}/Contents/Resources/Tokens.xml javadocset.xsl clean.html rm clean.html # index the docset echo "Indexing the docset ..." ${xcode_path}/usr/bin/docsetutil index ${doc_bundle} # archive the docset for publishing to feed echo "archiving the docset ..." ${xcode_path}/usr/bin/docsetutil package -output ${archive_name} ${doc_bundle}