HaxeBuild
HaxeBuild (or HxBuild) is a build tool for Haxe inspired by C++ build tools like premake.
Currently, it has a few features:
- Different combinations with Configs and Releases
- Automatic copying the included files/directories with include
- Installing libraries the hxbuild.json file contains (the ones in configs/targets should be specified with --config and/or --target)
- Exporting to .hxml file
- Getting the initial outDir value from config/target via ${outDir}
+ Example: `"outDir": "build"`, `"${outDir}" = "build"`, `"${outDir}/hl" -> "build/hl"`
Configuring
- Create
hxbuild.jsonfile in the source directory of the project - Add the properties. Example:
{
"main": "MainClass",
"outDir": "build",
"outFile": "Project",
"configs:Release": {
"defines": "Release"
},
"targets:HashLink": {
"target": "hl",
"outDir": "${outDir}/build"
}
}- Type in
haxelib run hxbuild build --config Release --target HashLinkto run the project
Tags
main- Main classclasspath- Class path (directory that contains all the classes)include(array) - Files/Directories to be copied to build directorydefines(array) - An array of defines (-D)libraries(array) - An array of libraries (-L) + Can be used to install the libraries withhxbuild installconfigs:(config_name)(object) - Specified configuration, example names: Release, Debug; Selected with--configtargets:(target_name)(object) - Specified target, example names: HashLink, C++; Selected with--targettarget- Target for Haxe to compile, like: -hl, -cpp, -js, etc.