On Tuesday, 22 November 2016 at 00:41:42 UTC, Meta wrote:
You could write a little script to generate an increasing
version and save it in a file. Then with Dub you can use a
pre-build or pre-generate command to call that script, and in
your D code do `enum version = import("version.txt");`. You can
do whatever you want with this text; process it, convert it to
an internal data structure, populate settings, etc.
I created a thread a little while ago that's somewhat on this
topic... It was partially about Dub pre-build and pre-generate
commands so you may find it useful.
http://forum.dlang.org/thread/mzipqtnimvexeddjt...@forum.dlang.org
Also another thread I created on the Dub subforum where the
creator goes into a little more detail:
http://forum.rejectedsoftware.com/groups/rejectedsoftware.dub/thread/8012/