aboutsummaryrefslogtreecommitdiffstats
path: root/libparc/parc/HeaderDoc/gen_parc_docset.sh
blob: 3a4dbbd40b27a1ef7f39902f57355488706e643b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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