Last active
August 29, 2015 14:17
-
-
Save skial/b915837e6d928dacfd04 to your computer and use it in GitHub Desktop.
Compiler.exclude and flat js package issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -cp src | |
| -main Main | |
| -js bin/test.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package; | |
| class Main | |
| { | |
| public static function main() { | |
| a.b.Test.main(); | |
| new a.b.Other(); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package a.b; | |
| @:keep class Other { | |
| public function new() { | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package a.b; | |
| @:build(Macro.build()) | |
| class Test { | |
| public static function main() { | |
| } | |
| public static function method(v:String) trace( v ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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