haxe-sublime-bundle
haxe-sublime-bundle copied to clipboard
Incorrect parsing of --macro in HXML
Things like --macro addMetadata("@:nativeChildren", "unityengine.MonoBehaviour")
are parsed incorrectly by the plugin (because of splitting by " "). I guess --macro
needs special handling.
Actually it may make sense to do split(" ", 1)
here for everything: https://github.com/clemos/haxe-sublime-bundle/blob/master/HaxeComplete.py#L822
should be fixed, please confirm ;)
Hm, it seems not to use --macro
for completion and ctrl+enter builds. Also, another problem is that ctrl+enter doesn't add classes specified in hxml. For example:
build.hxml for a unity project
--macro addMetadata("@:nativeChildren", "unityengine.MonoBehaviour")
-cs out
-D dll
-D net-ver=40
-net-lib G:\Unity\Data\Managed\UnityEngine.dll
Main
ctrl+enter run:
haxe -D dll -D net-ver=40 -net-lib G:\Unity\Data\Managed\UnityEngine.dll -cp F:\Code\playground --connect 6001 --cwd F:\Code\playground -cs out
completion run:
haxe -D dll -D net-ver=40 -net-lib G:\Unity\Data\Managed\UnityEngine.dll -cp F:\Code\playground --connect 6001 --cwd F:\Code\playground -D st_display --display F:\Code\playground\Main.hx@95 --no-output -cs out
The --macro
problem seems to be related to that it's checked as -macro
, like -cmd
when it should have double dash.
Ok I corrected --macro
.
As for the other problem, I wasn't aware you could just add Main
like this.
Is it documented somewhere ?
How is it different from adding -main
?
--main
specifies a class with the main
static function. when you use it, haxe generates a call to that function. however, when you simply specify modules by their dot-path, it just compiles them, which is useful for compiling pluggable libraries. i believe it's mentioned in haxe command line help :wink:
You can try for yourself by doing haxe -main Main -js test.js
vs haxe Main -js test.js
and looking at the output.
Ok, I'll see if I can implement that ;)