Skip to content

Instantly share code, notes, and snippets.

@skial
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save skial/b915837e6d928dacfd04 to your computer and use it in GitHub Desktop.

Select an option

Save skial/b915837e6d928dacfd04 to your computer and use it in GitHub Desktop.
Compiler.exclude and flat js package issue
-cp src
-main Main
-js bin/test.js
package;
#if macro
import haxe.macro.Compiler;
import haxe.macro.Context;
import haxe.macro.Expr;
#end
class Macro {
public static macro function build():Array<Field> {
var fields = Context.getBuildFields();
Compiler.exclude('a.b.Test');
return fields;
}
}
package;
class Main
{
public static function main() {
a.b.Test.main();
new a.b.Other();
}
}
package a.b;
@:keep class Other {
public function new() {
}
}
package a.b;
@:build(Macro.build())
class Test {
public static function main() {
}
public static function method(v:String) trace( v );
}
(function (console) { "use strict";
var Main = function() { };
Main.main = function() {
a.b.Test.main();
new a_b_Other();
};
var a_b_Other = function() {
};
Main.main();
})(typeof console != "undefined" ? console : {log:function(){}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment