07-22-2020 10:22 AM
How can I get/set the 'Build specification Description'?
Optionally, The Description text in 'Version Information'. The idea is to use one of these fields to generate a 'version log' file everytime a new version is built.
is it possible to programmatically get/set any of these? Till now all I could get was the Version Information numbers. (major/minor/fix/bluid) but not the rest of the fields.
Solved! Go to Solution.
07-22-2020 10:40 AM
If you are using Version Control Software, then your Version Log should reside inside the VCS logs. Several of us (including me) use the VCS Revision number as the "Build" component of the Version Information numbers, particularly since you can usually programmatically obtain this number from your VCS system and can programmatically set it before you do the actual Build. Note, however, that if you "do the logical step" of doing this as part of a "Pre-Build Action" that NI so nicely supplies, you will find that the Build spec of the freshly-built Executable hasn't changed (since NI "caches" this number before reading what you asked it to do "pre-Build", which I foolishly interpreted as "before the Build"). I've had a suggestion on the NI Idea Exchange to fix this, got a lot of push-back from NI, and came up with several work-arounds that I now use.
Bob Schor
07-22-2020 12:03 PM
The BuildSpec class has the Get Tag and Set Tag methods. The two tags you will want to work with are Bld_buildSpecDescription for the Build Spec Description and TgtF_fileDescription for the Version Description.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
07-23-2020 03:03 AM
Hi Bob & Andrew,
Thank you for your swift responses. I created a Post-Build Action VI which outputs the version information to a file as follows: