-
Notifications
You must be signed in to change notification settings - Fork 7
/
update-doxygen
106 lines (83 loc) · 2.27 KB
/
update-doxygen
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
#!/bin/bash
#
# This file is distributed under the Eclipse Public License 2.0.
# See LICENSE for details.
#set -x -v
set -e
if expr "$0" : '.*/.*' >/dev/null 2>&1 ; then
cmdDir=`dirname $0`
else
cmdDir='.'
fi
if test -r $cmdDir/coin-functions ; then
. $cmdDir/coin-functions
else
echo "Cannot find utility functions file coin-functions; exiting."
exit 1
fi
if [ x"${COINBREW_HOME-}" == x ]; then
if ! command -v coinbrew; then
export COINBREW_HOME=$(command -V coinbrew | head -n1 | cut -d ' ' -f 3)
else
echo "EXIT: To generate README, you must either have coinbrew in your"
echo " path or manually set COINBREW_HOME to the location of the"
echo " coinbrew repo."
exit 1
fi
fi
if ! git diff --exit-code --quiet HEAD ; then
echo "EXIT: There are uncommitted changes. I'm too afraid to proceed."
exit 1
fi
# figure out name of project from repo URL, remove possible .git suffix
topProjName=`git remote get-url origin`
topProjName=${topProjName##*/}
topProjName=${topProjName/.git/}
echo "Project : $topProjName"
branchName=`git rev-parse --abbrev-ref HEAD`
echo "Branch : $branchName"
if [[ "$branchName" != stable/* ]] ; then
echo "ERROR: Expected branchname to start with 'stable/"
exit 1
fi
# get tags from remote
git fetch -t
# get last release from current stable branch
lastRelease=`git tag --list "${branchName/stable/releases}*" | sort -V | tail -1`
echo "Checking out current release : $lastRelease"
git checkout $lastRelease
echo
echo "===> Making temporary directory and building doxygen docs..."
echo
mkdir tmp_doxygen
cd tmp_doxygen
../configure --prefix=$PWD
make doxydoc
cd -
echo
echo "===> Switching to gh-pages to update documentation..."
echo
if ! git checkout gh-pages; then
echo "EXIT: gh-pages doesn't seem to exist."
exit 1
fi
git pull --rebase
if [ -d Doxygen ]; then
git rm -r Doxygen
git commit -m "Removing old Doxygen documentation"
fi
mkdir Doxygen
cp -r tmp_doxygen/doxydoc/html/* Doxygen
git add Doxygen
git commit -m "Updating Doxygen documentation to release $lastRelease"
echo
echo "===> Removing temporary directory..."
echo
rm -rf tmp_doxygen
echo
echo "===> Done ..."
echo
echo "After reviewing the output, commit result by doing"
echo
echo " git push origin gh-pages"
echo