I was wondering whether it is possible to access external information - like the current date during compilation.
It would then be possible to do something like this:
class MyInfo {
private var buildDate:Int = --- AUTOMATICALLY INSERT THE CURRENT UNIX DATE TIME HERE ---;
public function getInfo():String { // example usage
return "This library was compiled the " + buildDate;
}
}
I thought about accessing this information in the compilation bat/sh/make file and then pass it to the compiler, too. (Something similar to "-D".) However the Haxe compiler does not seem to support an argument like:
haxe --main MyInfo --js test.js -SOMEARG date=$(date)
So that I could use the content of the variable date afterwards ...