forked from highperformancecoder/scidavis-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makeRelease.sh
executable file
·44 lines (40 loc) · 1.23 KB
/
makeRelease.sh
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
echo "old version=`git describe`"
fullversion=$1
version=${fullversion%%-*}
extra=-${fullversion##*-}
if [ $extra = "-$version" ]; then
extra=""
fi
echo $version $extra
# strip any leading 0s from patch
branch=${version%.*}
major=${branch%.*}
minor=${branch#*.}
patch=${version##*.}
scidavis_version=$[$major*65536 + $minor*256 + $patch]
rm -f libscidavis/src/version.cpp
cat >libscidavis/src/version.cpp <<EOF
#include "globals.h"
const int SciDAVis::scidavis_versionNo = $scidavis_version;
const char* SciDAVis::scidavis_version = "$version";
const char* SciDAVis::extra_version = "$extra";
const char * SciDAVis::release_date = "`date +"%b %d, %Y"`";
EOF
# also check that all translation files have been included
for i in scidavis/translations/*.ts; do
if git ls-files --error-unmatch >/dev/null; then
true;
else
echo "translation $i not checked in"
exit 1
fi
done
# update Doxyversion
rm -f Doxyversion
echo "PROJECT_NUMBER=$version" >Doxyversion
echo "$version" >doc/version.tex
# update scidavis.appdata.xml
date=`date +%Y-%m-%d`
sed -i "s/<release version=.*$/<release version=\"$version\" date=\"$date\">/" scidavis/scidavis.appdata.xml
git commit -a -m "Release $fullversion"
git tag -a -m "" $fullversion