I am trying to embed some build-time versions into the binary I create for a production build. So far I am not coming up with any great ideas. I could modify a .h file each time with major, minor version numbers and date 20210305 each time, check this into source control and build but seems there should be a way to make his more automatic.
I am looking into the use of emScript at build time with a pre-build directive but the ecmascript language supported seems too limited
My idea is to make a versions.h_template file and do string replacement like:
#define MAJOR_VERSION %major_version%
#define MINOR_VERSION %minor_version%
#define BUILD_DATE %build_date%
major_version and minor_version would come from a .properties file, .yml file or some such thing. build_date would be autogenerated like 20210320 by the build script.
the ecmascript v3 interpreter of emScript doesn't seem to do text replacements or date math with any ease.
Can you suggest the best way to do this?
I am looking into the use of emScript at build time with a pre-build directive but the ecmascript language supported seems too limited
My idea is to make a versions.h_template file and do string replacement like:
#define MAJOR_VERSION %major_version%
#define MINOR_VERSION %minor_version%
#define BUILD_DATE %build_date%
major_version and minor_version would come from a .properties file, .yml file or some such thing. build_date would be autogenerated like 20210320 by the build script.
the ecmascript v3 interpreter of emScript doesn't seem to do text replacements or date math with any ease.
Can you suggest the best way to do this?