OpenHantek
OH_VERSION.h
Go to the documentation of this file.
1
// define OH_VERSION as the version that is shown on top of the program
2
// if defined in this file it will tag the commit automatically
3
// via .git/hooks/post-commit (see below)
4
// the hook will then renamed from OH_VERSION to LAST_OH_VERSION
5
//
6
// if OH_VERSION is undefined (for development commits) OH_BUILD will be shown by OpenHantek
7
8
// next line shall define either OH_VERSION or LAST_OH_VERSION
9
//
10
#define OH_VERSION "3.2.5"
11
12
13
// do not edit below
14
15
#ifdef OH_VERSION
16
#undef VERSION
17
#define VERSION OH_VERSION
18
#else
19
#include "
OH_BUILD.h
"
20
#ifdef OH_BUILD
21
#undef VERSION
22
#define VERSION OH_BUILD
23
#endif
24
#endif
25
26
/* content of ".git/hooks/post-commit":
27
28
#!/bin/bash
29
30
# this file is called automatically after a commit
31
# it tags the commit if a version is defined in the version file
32
# inspired by: https://coderwall.com/p/mk18zq/automatic-git-version-tagging-for-npm-modules
33
34
# this file was updated during development (by hand)
35
#
36
OH_VERSION_H=openhantek/src/OH_VERSION.h
37
38
# check if the last commit changed the entry OH_VERSION in file ...OH_VERSION.h and extract the new version
39
#
40
OH_VERSION=$(git diff HEAD^..HEAD -- "$(git rev-parse --show-toplevel)"/${OH_VERSION_H}
41
| awk '/^\+\#define OH_VERSION/ { print $3 }' | tr -d '"')
42
43
# if commit was marked as OH_VERSION then tag it accordingly and change entry to LAST_OH_VERSION
44
#
45
if [ "$OH_VERSION" != "" ]; then
46
git tag -a $OH_VERSION -m "$(git log -1 --format=%s)"
47
sed -i 's|^#define[[:blank:]]*OH_VERSION|#define LAST_OH_VERSION|g' $OH_VERSION_H
48
echo "Created a new tag: $OH_VERSION"
49
fi
50
51
*/
OH_BUILD.h
OH_VERSION.h
Generated by
1.8.14