-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
69 lines (60 loc) · 2.69 KB
/
README
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
name: appver
author: Miroslav Safr <miroslav.safr@gmail.com>
web: http://safrm.net/projects/appver/
version:
description: multiplatformal version number/version time helper
content:
appver .................. script to pass or export git version in given format
install.sh .............. executes installation to /urs/bin dir
usage:
. appver .............. export version variables to current terminal e.g. APP_FULL_VERSION_TAG
appver ................ print version variables to stdout
appver 1.x.x .......... for packaging builds (without git tree) can be version strings passwd by argument
example:
<my-project-dir> $ . appver
APP_FULL_VERSION_TAG=0.0.1
APP_SHORT_VERSION_TAG=0.0.1
APP_BUILD_DATE=20120510_1312
<my-project-dir> $ export | grep APP_
declare -x APP_BUILD_DATE="20120510_1312"
declare -x APP_FULL_VERSION_AND_DATE="0.0.1 (20120510_1312)"
declare -x APP_FULL_VERSION_TAG="0.0.1"
declare -x APP_SHORT_VERSION_TAG="0.0.1"
usage in scripts without dependency:
#automatic version
if command -v appver &>/dev/null ; then . appver ; else APP_SHORT_VERSION=NA ; APP_FULL_VERSION_TAG=NA ; APP_BUILD_DATE=`date +'%Y%m%d_%H%M'` ; fi
qmake 2x usage:
#appver, win/lin version system
APP_FULL_VERSION_TAG=NA
APP_SHORT_VERSION_TAG=NA
unix {
exists( /usr/bin/appver ) {
#APP_BUILD_DATE=$$system(/usr/bin/appver | grep APP_BUILD_DATE | awk -F= '{print $2}')
#APP_FULL_VERSION_TAG=$$system(/usr/bin/appver | grep APP_FULL_VERSION_TAG | awk -F= '{print $2}')
#APP_SHORT_VERSION_TAG=$$system(/usr/bin/appver | grep APP_SHORT_VERSION_TAG | awk -F= '{print $2}')
system(/usr/bin/appver > ./appver.pri)
include(./appver.pri)
} else {
APP_BUILD_DATE=$$system(date +'\"%Y%m%d_%H%M\"')
APP_FULL_VERSION_TAG=$$system(git describe --tags --dirty=* 2> /dev/null)
APP_SHORT_VERSION_TAG=$$system(git describe --tags --abbrev=0 2> /dev/null)
}
}
win32 {
APP_BUILD_DATE=$$system(echo \"%date:~9,4%%date:~6,2%%date:~3,2%_%time:~0,2%%time:~3,2%\")
exists("C:\\progs\\Git\\bin\\sh.exe") {
APP_FULL_VERSION_TAG=$$system("C:\\progs\\Git\\bin\\sh.exe" -c \"/bin/git describe --tags --dirty=* 2> /dev/null \")
APP_SHORT_VERSION_TAG=$$system("C:\\progs\\Git\\bin\\sh.exe" -c \"/bin/git describe --tags --abbrev=0 2> /dev/null \")
}
}
message("APP_BUILD_DATE = " $$APP_BUILD_DATE)
DEFINES += APP_DATE=\\\"$$APP_BUILD_DATE\\\"
message("APP_FULL_VERSION_TAG = " $$APP_FULL_VERSION_TAG)
DEFINES += APP_FULL_VERSION_TAG=\\\"$$APP_FULL_VERSION_TAG\\\"
DEFINES += APP_SHORT_VERSION_TAG=\\\"$$APP_SHORT_VERSION_TAG\\\"
message("APP_SHORT_VERSION_TAG = " $$APP_SHORT_VERSION_TAG)
releasing packaging:
$ appver 1.0.2
APP_FULL_VERSION_TAG=1.0.2
APP_SHORT_VERSION_TAG=1.0.2
APP_BUILD_DATE=20140203_1618