Skip to content

Instantly share code, notes, and snippets.

@skial
Created December 21, 2011 12:11
Show Gist options
  • Save skial/1505801 to your computer and use it in GitHub Desktop.
Save skial/1505801 to your computer and use it in GitHub Desktop.
Haxe Macro | Access build field doc
package uhu.macro.doc;
import haxe.macro.Context;
import haxe.macro.Expr;
import neko.io.File;
import neko.io.FileOutput;
/**
* ...
* @author Skial Bainn
*/
class Build {
public static var file:FileOutput;
@:macro
public static function build():Array<Field> {
file = File.write('log.txt');
var fields:Array<Field> = Context.getBuildFields();
for (n in fields) {
file.writeString('' + n.name + ' | ' + n.doc + '\n');
}
file.close();
return fields;
}
}
package uhu.macro;
/**
* ...
* @author Skial Bainn
*/
@:autoBuild(uhu.macro.doc.Build.build())
interface Doc {}
main | null
package ;
import uhu.macro.Doc;
/**
* ...
* @author Skial Bainn
*/
class Main implements Doc {
/**
* kkllkklklklklklklk
*/
public static function main():Void {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment