File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -15,3 +15,22 @@ android {
15
15
target.path = $$[INSTALL_ROOT ]/usr/bin
16
16
}
17
17
INSTALLS +=target
18
+
19
+ # Find out git hash
20
+ unix :system (which git ):HAS_GIT =TRUE
21
+ win32 :system (where git.exe ):HAS_GIT =TRUE
22
+ contains (HAS_GIT, TRUE ) {
23
+ GIT_HASH =$$system (git log -1 --format =%H )
24
+ !system (git diff-index --quiet HEAD ): GIT_HASH =" $$GIT_HASH-dirty"
25
+ GIT_VERSION =$$system (git describe --tags --exact-match )
26
+ isEmpty (GIT_VERSION ) : GIT_VERSION =" unknown"
27
+ } else {
28
+ GIT_HASH =" unknown"
29
+ GIT_VERSION =" unknown"
30
+ }
31
+
32
+ isEmpty (GIT_VERSION ) : error ("No suitable tag found" )
33
+ isEmpty (GIT_HASH ) : error ("No hash available" )
34
+
35
+ DEFINES +=" GIT_HASH=\\\" $$GIT_HASH \ \\""
36
+ DEFINES +=" GIT_VERSION=\\\" $$GIT_VERSION \ \\""
Original file line number Diff line number Diff line change @@ -254,6 +254,9 @@ int main(int argc, char **argv)
254
254
return 1 ;
255
255
} else if (arg == " --print-debug" ) {
256
256
config.flags |= Config::PrintDebugMessages;
257
+ } else if (arg == " --version" ) {
258
+ printf (" Appcontroller version: " GIT_VERSION " \n Git revision: " GIT_HASH " \n " );
259
+ return 0 ;
257
260
} else {
258
261
args.prepend (arg);
259
262
break ;
You can’t perform that action at this time.
0 commit comments