For an advanced usage and some tips here is a great article by Andy Li (https://stackoverflow.com/users/267998/andy-li)
http://blog.onthewings.net/2013/03/04/hxml-tricks-every-haxe-user-should-know/
Commenting a hxml file
Lines starting with hash (#) won't be treated as arguments.
#Yay! Comments!
Run project right after compilation
Use -cmd
to run any command line after successful compilation.
#C++
-cpp bin
-main Test
-cmd ./bin/Test
#Flash
-swf Test.swf
-main Test
-cmd path/to/FlashDebugger Test.swf
#Neko
-neko Test.n
-main Test
-cmd neko Test.n
For Neko target there is special shortcut for building and running -x Test
.
Extra arguments
Appending arguments also works, for example if you want to build debug version
haxe project.hxml -debug
Multiple compilations at once
Use --next
to separate different target/configuration builds. Use --each
to apply arguments to every build within hxml.
#lib will be used in every '--next' build
-lib jQueryExtern
--each
#build MainPage
-js script/MainPage.js
-main MainPage
--next
#build ContactPage
-js script/ContactPage.js
-main ContactPage
#build AlbumPage
--next
-js script/AlbumPage.js
-main AlbumPage
Including hxmls
You can further separate different build configurations by creating an hxml for every configuration.
client.hxml:
-main Client
-js client.js
server.hxml:
-main Server
-neko server.n
all.hxml:
client.hxml
--next
server.hxml
Builds both: haxe all.hxml