aboutsummaryrefslogtreecommitdiffstats
path: root/libparc/parc/HeaderDoc/gen_parc_docset.sh
diff options
context:
space:
mode:
Diffstat (limited to 'libparc/parc/HeaderDoc/gen_parc_docset.sh')
-rw-r--r--libparc/parc/HeaderDoc/gen_parc_docset.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/libparc/parc/HeaderDoc/gen_parc_docset.sh b/libparc/parc/HeaderDoc/gen_parc_docset.sh
new file mode 100644
index 00000000..3a4dbbd4
--- /dev/null
+++ b/libparc/parc/HeaderDoc/gen_parc_docset.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+# Copyright (c) 2017 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SETTING
+# location of XCODE docset
+DOCSET_DIR=../Docset/com.parc.csl.parc.docset
+
+# location of html code document, generated by headerdoc2html
+DOCUMENT_DIR=$DOCSET_DIR/Contents/Resources/Documents
+
+# location of hautelook templates, Info.plist Nodes.xml
+DOCSET_TEMPLATE_DIR=./
+
+# location of our source code, where headerdoc2html will spider through
+SOURCE_DIR=../algol/
+
+# clear screen
+clear
+
+# delete old docset and start from fresh, this will kill XCODE if its running. good for development only, comment out for production.
+rm -rf $DOCSET_DIR
+
+# create document directory
+mkdir -p $DOCUMENT_DIR
+
+# generate html code document for source code. -j will recognize java comment tag ex. /** */
+# https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/HeaderDoc/usage/usage.html#//apple_ref/doc/uid/TP40001215-CH337-SW2
+headerdoc2html --config-file headerDoc2HTML.config --class-as-composite -j -o $DOCUMENT_DIR $SOURCE_DIR
+#headerdoc2html -j -o $DOCUMENT_DIR $SOURCE_DIR/*.h
+
+# generate main index file. -d will generate Tokens.xml for us.
+#
+# http://opensource.apple.com/source/headerdoc/
+# https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/HeaderDoc/usage/usage.html#//apple_ref/doc/uid/TP40001215-CH337-SW1
+#
+gatherheaderdoc -d $DOCUMENT_DIR
+
+# copy required template files for apple docset
+cp $DOCSET_TEMPLATE_DIR/Info.plist $DOCSET_DIR/Contents/
+cp $DOCSET_TEMPLATE_DIR/Nodes.xml $DOCSET_DIR/Contents/Resources/
+cp $DOCUMENT_DIR/Tokens.xml $DOCSET_DIR/Contents/Resources/
+
+# create and validate apple docset indexes
+/Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil index -verbose -debug $DOCSET_DIR
+/Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil validate -verbose -debug $DOCSET_DIR
+