I need to write git information: Commit name, tags, branch, etc to a binary (exe) file.
It is needed to run strings * | grep git, on that file to simply view latest git info about it. I know that AssemblyInfo is displayed when I run this command (without grep), but I'm facing two possible problems:
I'm not sure if I can write to AssemblyInfo from code, to run 'git log' command and then get its output and write into AssemblyInfo.
If I want to use command 'git log' then it's not going to work on Windows, but it is possible that my App will be built on Windows and not on unix environment.
Maybe you know another way to do that?
This is usually done in your build script, filling a templated version of your AssemblyInfo (look at mustache, a templating language).
This build step does the following:
Then your software build continues as usual.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With