I've been trying to pass a build id (and date) to my c++ project via msbuild such that each build that gets created from Jenkins ends up with a build number and date that can be accessed from a panel in my program.
On the surface this seemed like an easy task. Just create a constant definition that gets re-defined by msbuild to be the current date and build number.
I'm trying to pass the build number and ID to msbuild with these command line properties
/p:Configuration=%DebugAxis%;DefineConstants="BUILD_NUMBER=%BUILD_NUMBER%;BUILD_ID=%BUILD_ID%"
And then I just sent my variables that get displayed in my panel to the defined variables:
mBuildNumber = BUILD_NUMBER;
mBuildId = BUILD_ID;
From all the documentation I've read it seems like this should be working but so far no go (the value never changes). Is there a trick to this that I am missing? Note: this is for a C++ NOT C# project.