Re: [Interest] x-platform way to pull app version?
2016-02-02 18:45 GMT+01:00 Elvis Stansvik : > Den 1 feb 2016 8:20 em skrev "André Somers" : >> >> Easiest is to let your buildsystem generate some cpp code with the version >> numbers in each build. We compiled in version number, git id an time & date >> with a simple script called from qmake on every build. > > Small related tip from me: > > GIT_VERSION=$$system(git \ > > --git-dir $$shell_quote($$PWD/.git) \ > > --work-tree $$shell_quote($$PWD) \ > > describe --always --tags) > > This will give e.g. "v1.0" if building tag "v1.0" and "vX.Y-12-gabcdef" if > building Git commit abcdef which is the 12:th commit after tag "vX.Y". To clarify: I'm not using this for VERSION in the .pro/code, since (I think) the VERSION must be on "X.Y.[Z]" format. But I am using it e.g. as part of the ZIP filename when I produce my Windows build on Appveyor. Elvis > > Elvis > >> >> André >> >> Verstuurd vanaf mijn iPhone >> >> > Op 1 feb. 2016 om 16:35 heeft "Jason H" het volgende >> > geschreven: >> > >> > Currently, I have a string that I have to manually maintain, is there a >> > way I can call some function and get my application version (that's in the >> > plist or manifest)? >> > ___ >> > Interest mailing list >> > Interest@qt-project.org >> > http://lists.qt-project.org/mailman/listinfo/interest >> ___ >> Interest mailing list >> Interest@qt-project.org >> http://lists.qt-project.org/mailman/listinfo/interest ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] x-platform way to pull app version?
Den 1 feb 2016 8:20 em skrev "André Somers" : > > Easiest is to let your buildsystem generate some cpp code with the version numbers in each build. We compiled in version number, git id an time & date with a simple script called from qmake on every build. Small related tip from me: GIT_VERSION=$$system(git \ --git-dir $$shell_quote($$PWD/.git) \ --work-tree $$shell_quote($$PWD) \ describe --always --tags) This will give e.g. "v1.0" if building tag "v1.0" and "vX.Y-12-gabcdef" if building Git commit abcdef which is the 12:th commit after tag "vX.Y". Elvis > > André > > Verstuurd vanaf mijn iPhone > > > Op 1 feb. 2016 om 16:35 heeft "Jason H" het volgende geschreven: > > > > Currently, I have a string that I have to manually maintain, is there a way I can call some function and get my application version (that's in the plist or manifest)? > > ___ > > Interest mailing list > > Interest@qt-project.org > > http://lists.qt-project.org/mailman/listinfo/interest > ___ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] x-platform way to pull app version?
On Monday 01 February 2016 20:20:51 André Somers wrote: > Easiest is to let your buildsystem generate some cpp code with the version > numbers in each build. We compiled in version number, git id an time & date > with a simple script called from qmake on every build. Note that it's a bad idea to embed the time and date. A build from the exact same sources should produce the exact same binary. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] x-platform way to pull app version?
Easiest is to let your buildsystem generate some cpp code with the version numbers in each build. We compiled in version number, git id an time & date with a simple script called from qmake on every build. André Verstuurd vanaf mijn iPhone > Op 1 feb. 2016 om 16:35 heeft "Jason H" het volgende > geschreven: > > Currently, I have a string that I have to manually maintain, is there a way I > can call some function and get my application version (that's in the plist or > manifest)? > ___ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] x-platform way to pull app version?
On Monday 01 February 2016 16:35:37 Jason H wrote: > Currently, I have a string that I have to manually maintain, is there a way > I can call some function and get my application version (that's in the > plist or manifest)? Please search the Cocoa and Win32 API. That's not a Qt question. If you want to automate your version number, you can set a macro with it and then save: VERSION = 1.0.1 DEFINES += VERSION=\\\"$$VERSION\\\" in .cpp: const char *appversion() { return VERSION; } -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
[Interest] x-platform way to pull app version?
Currently, I have a string that I have to manually maintain, is there a way I can call some function and get my application version (that's in the plist or manifest)? ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest