30 lines
720 B
Haxe
Executable File
30 lines
720 B
Haxe
Executable File
package;
|
|
|
|
#if macro
|
|
import haxe.macro.Context;
|
|
import haxe.macro.Expr;
|
|
#end
|
|
|
|
class Meta {
|
|
|
|
#if macro
|
|
private static inline var VERSION:String = "version";
|
|
private static inline var BUILD:String = "build";
|
|
|
|
private static var data:Map<String, Dynamic> = new Map<String, Dynamic>();
|
|
#end
|
|
|
|
macro static public function getBuild():ExprOf<String> {
|
|
return Context.makeExpr(data.get(BUILD), Context.currentPos());
|
|
}
|
|
|
|
macro static public function getVersion():ExprOf<String> {
|
|
return Context.makeExpr(data.get(VERSION), Context.currentPos());
|
|
}
|
|
|
|
macro static public function set(version:String) {
|
|
data.set(BUILD, Date.now().toString());
|
|
data.set(VERSION, version);
|
|
return macro {};
|
|
}
|
|
} |