BuildMacro.hx 382 B

123456789101112131415161718192021
  1. package pack;
  2. import haxe.macro.Context;
  3. class BuildMacro {
  4. #if macro
  5. static var builtTypes = [];
  6. #end
  7. static public function build():Array<haxe.macro.Expr.Field> {
  8. #if macro
  9. builtTypes.push("" + Context.getLocalClass());
  10. #end
  11. return null;
  12. }
  13. macro static public function report() {
  14. builtTypes.sort(Reflect.compare);
  15. return macro $v{builtTypes.join(", ")};
  16. }
  17. }