[Qt-creator] Is there a way to automatically tag builds?

Orgad Shaneh orgads at gmail.com
Thu Jun 12 08:07:22 CEST 2014


On Wed, Jun 11, 2014 at 6:10 PM, Murphy, Sean <smurphy at walbro.com> wrote:

> I was wondering if there is any way to automatically tag builds using
> QtCreator?  If it's important, I'm on Windows and using Git as my version
> control.
>
> What I'd like to have happen:
> - I'd have an "About <App Name>" dialog that would include a build number
> string.
> - The build number string would get automatically updated each time I
> recompiled
> - Somehow the code in Git would get automatically tagged with the current
> build number
>
> The last one seems kind of tough?  When I compile, I'm going to have local
> changes that aren't checked into Git yet, so if I just tagged the
> repository with the build number at that point, the code in the repository
> isn't going to match the code that went into the executable.  So somehow
> I'd need QtCreator to automatically check in all code and tag it with the
> build number?
>
> Basically, I'm looking for a foolproof way of stumbling across an
> executable days/weeks/months from now, and being able to roll my repository
> back to that exact code base.  Right now, I'm just too hit-or-miss about
> remembering to check the code into Git every time I make a single change
> and compile.  And I don't have currently a build numbering system at all.
>
> I'd love to hear how other people are doing it, especially with QtCreator,
> since I'd love to just learn how to do it once, and have it work for all
> platforms.
>
> Sean
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator
>


We're using a script similar to this <http://pastebin.com/UJJC9rWA>, that
generates a version header.

Notice that in case of local changes, it *replaces* -g<hash> with
-s<stash>. If you want both of them, just append the stash instead of
replacing.

The input header should contain something like:

const char VERSION[] = "$VERSION";

- Orgad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20140612/60f39878/attachment.html>


More information about the Qt-creator mailing list