I'm calling a user program to make a file called buildNr.h which contains
#define _BUILD_ 123
This file is included in the project. I inserted the command into the "Options for Target - User - Run User ..." This works but the disadvantage is, the tool is called every time a file gets compiled and since the project contains >12 files its timeconsuming and increments _BUILD_ by 12. Any better solution?
I do not know if this is suitable for you: In our projects, we define some bytes at fixed location and are patching the build number after the linker run by using "After Build/Rebuild: Run User Program #1". By this, a new number is only assigned if the build was completed successfully.
Another good idea. I will think about it. Thanks.
"a new number is only assigned if the build was completed successfully"
Yes, but a successful build does not indicate that the bug has been fixed, or that the new feature is complete, does it?
My approch is as follow: During testing I only compile the modified files using "Build Target". When testing is finished I'll use "Build all Target Files". That's the moment I want to increment _BUILD_.
Yes, but a successful build does not indicate that the bug has been fixed, or that the new feature is complete, does it? Of course not. It is just a build number. For customer releases, the build number becomes a release label.