Compiler arguments can be stored in a .hxml file and can be executed with
In hxml it is possible to use newlines and comments which makes it easier to maintain Haxe build configurations.
It is possible to supply more arguments after the hxml file, e.g.
haxe build.hxml -debug.
This example has a configuration which compiles the class file
bin/homepage.js, which is located in the
src class path. And uses full dead code elimination.
-cp src -dce full -js bin/homepage.js -main website.HomePage
Hxml configurations allow multiple compilation using these arguments:
--nextSeparate several Haxe compilations.
--eachAppend preceding parameters to all haxe compilations separated by
--next. This reduces the repeating params.
src as class path and uses full dead code elimination.
-cp src -dce full --each -js bin/homepage.js -main website.HomePage --next -js bin/gallery.js -main website.GalleryPage --next -js bin/contact.js -main website.ContactPage
Inside .hxml files use a hash (i.e.
#) to comment out the rest of the line.
Calling build configurations inside HXML:
It is possible to create a configuration that looks like this:
build-server.hxml --next build-website.hxml --next build-game.hxml