Auto Build Number?

EDIT: ahh scrap that I thought this was a build number, but it isn’t, it’s a representation of the Project Version.

Is there an automatic build number available? If not how do people deal with it?

Just looking into using the versionNumber, however it doesn’t seem to increase with each build although it’s a high number so it seems it did at one point. Is there some code I need or Projucer setting required to make it increment?

__DATE__

can act as build identifier

1 Like

I discovered Time:: getCompilationDate() recently:

https://docs.juce.com/master/classTime.html#a4bcdd6953120779dfba089902a91983d

Matt

Problem with that one is that it’s only updated when the .obj with the implementation is rebuild. Which might not be when you expect it to be because all of the source files to generate the obj might still be the same on the next build. Cool to have it, but not the same as “the date this binary was linked”.

If you’re always doing clean rebuilds, then this isn’t a problem though.

JUCE modules are always rebuilt. In CMake speak, they are interface targets, so they will always be recompiled each time the project is built.

Hmm, I don’t yet use cmake - at least not for JUCE based projects and I had a situation in which a prerelese build expiry screen which was triggered due to a calculation involving this function appeared before it was intended to appear. A clean rebuild resolved this.

But despite this: are you sure? I have some rather huge JUCE modules and if they are rebuild each time I hit CMD+R, I’d have to restructure them to be regular (i.e non-interface) static libraries. Otherwise the turnaround times would be a huge productivity damper.

Yes, in both cmake and the projucer this is how the JUCE build process works. If you have custom modules that don’t actually reference JUCE types, I would highly recommend making them regular C++ libraries instead.

I’m in the same camp as @TurboCyber, with both Projucer and cmake my experience is that building from scratch takes a lot longer than making a change to either the top level or one of my custom modules, but of course this is just anecdata and I’ve no actual concrete knowledge to explain my experience.

Perhaps it’s just something Xcode is doing?