forked from pocoproject/poco
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmkdocumentation
More file actions
executable file
·139 lines (116 loc) · 2.54 KB
/
mkdocumentation
File metadata and controls
executable file
·139 lines (116 loc) · 2.54 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
#! /bin/sh
#
# mkdocumentation
#
# Create reference documentation for a POCO release.
#
# Usage:
# mkdocumentation [-u] [-t <reltag>] [-f <compfile>] {<component>}
#
# -u: Upload file to release repository.
# -t: Specify release tag.
# -f <compfile>: Component list file
# -c <config>: Build using the given configuration
# <components>: Additional components to include
#
# Environment:
# $POCO_BASE: POCO base directory (e.g., "/cygdrive/p/poco-1.2")
#
# Prerequisites:
# PocoDoc must be in PATH
#
if [ "$POCO_BASE" = "" ] ; then
echo "Error: POCO_BASE not set."
exit 1
fi
make=make
include=`dirname $0`
build=$POCO_BASE/stage/docbuild
dist=$POCO_BASE/releases
docConfig=$POCO_BASE/PocoDoc/cfg/mkdocumentation.xml
read version <$POCO_BASE/VERSION
osname=`uname -s | tr ' ' '_'`
osarch=`uname -m | tr ' ' '_'`
comps=""
specfile=""
tag=""
config=""
while [ "$1" != "" ] ;
do
if [ "$1" = "-f" ] ; then
shift
specfile=$1
shift
elif [ "$1" = "-t" ] ; then
shift
tag=$1
shift
elif [ "$1" = "-c" ] ; then
shift
config=$1
shift
elif [ "$1" = "-C" ] ; then
shift
docConfig=$1
shift
elif [ "$1" = "-v" ] ; then
shift
version=$1
shift
else
comps="$comps $1"
shift
fi
done
if [ "$specfile" != "" ] ; then
while read c
do
comps="$comps $c"
done <$specfile
fi
allcomps="Foundation XML JSON Util Net $comps"
#
# Clean build directory
#
echo "Cleaning build directory: $build"
rm -rf $build
mkdir -p $build
mkdir -p $dist
#
# Copy POCO sources into build directory
#
echo "Copying sources"
mkrelease -o $build $version $comps
#
# Make all files writeable
#
chmod -R +w $build
#
# Generate documentation
#
echo "Generating documentation"
# Create a PocoDoc configuration file
docVersion=$version
if [ $tag ] ; then
docVersion="$docVersion-$tag"
fi
docPath=$dist/poco-${docVersion}-doc
includes=""
for inc in `find $build -name include -print` ; do
includes="$includes,-I$inc"
done
echo "PocoBuild=$build" >>$build/PocoDoc.ini
echo "PocoBase=$POCO_BASE" >>$build/PocoDoc.ini
echo "PocoDoc.output=$docPath" >>$build/PocoDoc.ini
echo "PocoDoc.version=$docVersion" >> $build/PocoDoc.ini
echo "Includes=$includes" >> $build/PocoDoc.ini
PocoDoc --config=$docConfig --config=$build/PocoDoc.ini
cd $dist
chmod -R ugo+rw poco-${docVersion}-doc
chmod -R go+r poco-${docVersion}-doc
tar cf poco-${docVersion}-doc.tar poco-${docVersion}-doc
gzip -f poco-${docVersion}-doc.tar
if [ -x /usr/bin/zip ] ; then
/usr/bin/zip -r -q poco-${docVersion}-doc.zip poco-${docVersion}-doc
fi
echo "Done."