[SOLVED] How to get the build number

I can see in an application properties (mac) the build number (ex: 0.1.1456)

Is there a way to get this number at compile time (I just want to store it in a static inline var)?

I’ve looked around in the OpenFL source but I can’t find anything useful.

It’s in the file Export/.build, so a simple macro would do the trick.

If you don’t know how to do such a macro, or just don’t want to, see this lib https://github.com/jasononeil/compiletime

2 Likes

thanks ibilon

I’ve looked for it on google but I couldn’t find it.
super easy

cheers


if somebody is looking for the same, this is the easy/fast and complete solution

shell

haxelib install compiletime

project.xml

<haxelib name="compiletime" />

in your code

public static inline var APP_BUILD = CompileTime.readFile("Export/.build");

and that’s it. :wink:

1 Like