-
Notifications
You must be signed in to change notification settings - Fork 3
/
version
executable file
·32 lines (30 loc) · 1.32 KB
/
version
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
#!/bin/csh
# This script is called by 'make' to set the appropriate flags
# required for building a specific version of YAXX.
# It may be used independently to display what is currently checked-out.
# Please, read "Versionning.md" in the docs.
cd `dirname $0`
set DESCRIBE = `git describe --long`
set VERSION = `echo $DESCRIBE | cut -d- -f1`
set BRANCH = `git rev-parse --abbrev-ref HEAD`
# if ($BRANCH == "master") then
# set CODENAME = `git cat-file tag $VERSION | tail -n+6 | head -n 1`
# else
# set CODENAME = `git config branch.$BRANCH.description | head -n 1`
# endif
set CODENAME = `git config branch.$BRANCH.description | head -n 1`
set VERSION = `echo $VERSION | sed 's/\./_/'`
set COMMIT = `echo $DESCRIBE | cut -d- -f2`
set UXTIME = `git show --format=%at | head -1`
set DATE = `date --date=@$UXTIME '+%d %b %Y'`
sed 's|<string name="versionname">.*</string>|<string name="versionname">'"$CODENAME"'</string>|' < ./android/res/values/strings.xml >./android/res/values/strings.xml.tmp && mv ./android/res/values/strings.xml.tmp ./android/res/values/strings.xml
if ($#argv == 0) then
echo "# Codename: '$CODENAME' (branch $BRANCH)"
echo "# Version: $VERSION"
echo "# Patch: $COMMIT"
echo "# Date: $DATE"
else
echo $1 += \
-DVERSION=\"REXX-Jaxo-$VERSION-$COMMIT 4.04 $DATE\" \
-DCODENAME=\"$CODENAME\"
endif