Multiple duplicates: https://stackoverflow.com/search?q=svnversion
I’m using TortoiseSVN with SVN Service running as a service on a windows server.
I would like the version / build number in the project to be updated as or after the project is committed. So that the correct version / build on the project will be reflected in several places such as log files, Resource tables, Help > About Etc…
Thanks…
You can do this in the build script and other places right before you make EXEs, install files, etc –
What I did to add it to my resources/version info was make a template file for my rc file, use the macro substitution, then add a call to SubWCRev in the prebuild step of my EXE’s project.
See this
SubWCRev is a tool you can use for this.
$WCREV$ is the macro that gets replaced with the current svn revision.
Each template file is in the SVN repository but the actual files that get compiled/interpreted are generated from those. So just prior to building each generated output (exe, installer, release notes, etc) you would run the subwcrev tool and replace the macros.