Web IDE - macro to provide build number?


#1

Is there macro or equivalent that can be used to determine the build number? Would like to include this in the version numbering.


Cannot flash new code
#2

This should help: https://github.com/spark/firmware/blob/3c9fff9de0634d42a2703f03d189879e60b6409d/system/inc/system_version.h#L63


#3

@kennethlimcp thanks for this, but it is not what I was after.

Am wanting to automatically retrieve the build number of the user application that is being written, not the operating kernel (Particle firmware).

For example, the first time you compile the code, the build number will be one, the next compile it will be two and so on.

Hope this makes sense!


#4

I don’t think the build farm keeps track of your build history - which would be a requirement to maintain a build number.
But you could use __TIME__ & __DATE__ or __TIMESTAMP__ to keep track of the chronology

(With some luck the build farm may even support BUILD_SOURCE_EPOCH for a sortable timestamp)


#5

@scruffr, excellent solution!

Case closed with thanks!