-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprocessFramework.sh
More file actions
executable file
·143 lines (123 loc) · 3.62 KB
/
processFramework.sh
File metadata and controls
executable file
·143 lines (123 loc) · 3.62 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/bin/sh
#
# This script is used to process frameworks for the developer.apple.com
# website. Since the script is also somewhat handy for anybody else
# doing similar amounts of procesing, I'm including it here, though you
# will probably want to change some of the options to headerDoc2HTML.pl
# and gatherHeaderDoc.pl if you use it.
#
# The script is straightforward. It reads a file called
# FrameworkList that contains lines in the form
#
# /path/to/headers MyFrameworkName
#
# (with a *tab* between words) and processes the directory "headers",
# storing results in a folder called MyFrameworkName. The Master TOC
# file is named MyFrameworkName.html instead of the usual masterTOC.html.
#
# Finally, the third argument is used to create an xml file that
# is used to store metadata about the newly-generated documentation
# directory. If you aren't in our group at Apple, that part
# is probably not relevant to you, but it isn't worth maintaining
# a separate version for such a tiny option.
#
FRAMEWORK_OUTPUT="framework_output"
COPYFRAMEWORK="copyframework"
XML=""
if [ "x$1" = "x-X" ] ; then
XML="-X"
shift
FRAMEWORK_OUTPUT="framework_output_xml"
COPYFRAMEWORK="copyframework_xml"
fi
EVERYTHING=""
if [ "x$1" = "x-E" ] ; then
EVERYTHING="-E"
shift
fi
ASK=0
if [ "x$1" = "x-q" ] ; then
ASK=1
shift
fi
FRAMEWORKS="$(cat FrameworkList | grep -v '^\#')";
oldifs="$IFS"
# NOTE: This is intentionally a string containing a newline.
IFS="
"
for frameworkline in $FRAMEWORKS ; do
if [ "$frameworklineX" != "X" ] ; then
framework="$(echo $frameworkline | cut -f1)"
frameworkName="$(echo $frameworkline | cut -f2)"
echo "FRAMEWORK: $framework"
echo "FRAMEWORKNAME: $frameworkName"
DO="y"
if [ "$ASK" = "1" ] ; then
echo "Process this framework? (y/n) "
read DO
fi
if [ "$DO" = "y" -o "$DO" = "Y" ] ; then
frameworkDir="$(echo "$framework" | sed 's/\/$//g')"
# frameworkName=`basename $framework`
outputDir="$FRAMEWORK_OUTPUT/$frameworkName"
rm -rf $outputDir
mkdir -p $outputDir
echo "Processing $frameworkDir into $outputDir";
delete=0
frameworkHDOC="frameworkHDOC/$frameworkName.hdoc"
EXCLUDE=0
if [ -f "frameworkHDOC/$frameworkName.skiplist" ] ; then
EXCLUDE=1
EXCLUDELISTFILE="frameworkHDOC/$frameworkName.skiplist"
fi
echo "HDOC FILE WOULD BE $frameworkHDOC"
if [ -f "$frameworkHDOC" ] ; then
echo "COPYING FRAMEWORK..."
if [ -d $COPYFRAMEWORK ] ; then
rm -rf $COPYFRAMEWORK;
fi
mkdir $COPYFRAMEWORK;
cp -L $frameworkHDOC $COPYFRAMEWORK;
cp -L -R $frameworkDir $COPYFRAMEWORK;
frameworkDir="$COPYFRAMEWORK"
cat $frameworkHDOC
delete=1
echo "DONE COPYING FRAMEWORK."
fi
# ls $frameworkDir
if [ $EXCLUDE -eq 1 ] ; then
./headerDoc2HTML.pl $XML $EVERYTHING --apple --auto-availability -H -O -j -Q -n -p -e $EXCLUDELISTFILE -o $outputDir $frameworkDir
else
./headerDoc2HTML.pl $XML $EVERYTHING --apple --auto-availability -H -O -j -Q -n -p -o $outputDir $frameworkDir
fi
if [ $? != 0 ] ; then
echo "HeaderDoc crashed. Exiting."
exit -1;
fi
if [ "x$XML" = "x" ] ; then
./gatherHeaderDoc.pl $outputDir index.html
if [ $? != 0 ] ; then
echo "GatherHeaderDoc crashed. Exiting."
exit -1;
fi
fi
if [ $delete == 1 ] ; then
echo "Cleaning up."
# echo "Will delete $frameworkDir";
# sleep 5;
chmod -R u+w $COPYFRAMEWORK
rm -rf $COPYFRAMEWORK
fi
fi
fi
done
if [ "x$XML" = "x" ] ; then
if [ -f "./breadcrumbtree.pl" ] ; then
if which perl5.8.9 > /dev/null ; then
perl5.8.9 ./breadcrumbtree.pl $FRAMEWORK_OUTPUT
else
./breadcrumbtree.pl $FRAMEWORK_OUTPUT
fi
fi
fi
IFS="$oldifs"