What's the D way of application version numbers?

Rikki Cattermole alphaglosined at gmail.com
Sun Jan 12 14:06:42 PST 2014


On Sunday, 12 January 2014 at 19:11:12 UTC, Adam D. Ruppe wrote:
> On Sunday, 12 January 2014 at 18:36:19 UTC, Russel Winder wrote:
>> With C++ and Python, it is idiomatic to put the application 
>> version number in a separate file that can then be processed
>> by the build system.
>
> That's the way I do it in D too:
>
> file VERSION says "1.0"
>
> dmd -J. myfile.d
>
> enum version = import("VERSION");
> // use it now like any other string in D

I was gonna suggest this but with using dub to generate it off of 
e.g. git tag pre compile.


More information about the Digitalmars-d-learn mailing list