I am just returning to OpenFL/Haxe and I am having an issue with building a library from
CLI. When I run the following it says it does not know what -clean is? Unfortunately
I have not found a list of switches, so any advice on how to run the build
command with a clean switch wold be appreciated :
haxelib run hxcpp Build.xml -Dandroid -clean
Welcome to the OpenFL forums Erica,
You can check the haxe help like that to discover some flags:
To compile a simple project I may do something like that:
haxe -main MyMainClass -java outputdir
You can use an xml or json file to keep the config inside and so on… I don’t like so much the approach and I am usually more comfortable by using a Makefile.
To compile an OpenFL you really need project.xml file configured with the libraries and so on, when you have it you can call the compiler like that. Here some examples (the openFL of this example is for sure configured for the project which it compiled.):
openfl test -minify project.xml html5 -j16 -Ddom
haxelib run lime test project.xml android -j16 -Dlegacy
haxelib run openfl test project.xml ios -j16 -Dlegacy -simulator
You can check the help of the openFL compiler and its flag like that:
haxelib run openfl help
When I started I remember I remember it was a bit OpenFL and Haxe for those details, different helpers and compilers and even the help parameter was not that obvious to find.
I have a little github repo with some simple examples, each example has its own files to compile (which are very basic and repeptitive) but if you want to see basic things working here is the link:
Note: Check better the demos under the folder Events.
I would recommend using the
lime command for this
lime rebuild hxcpp android -clean
This builds with all the binaries used by Lime projects, and ensures consistency in the flags used. You can use this for any native extension:
lime rebuild lime android
lime rebuild my-native-extension android
lime rebuild android assumes “lime” as the library to rebuild, but you can point it to other projects that follow a standard directory/file structure
Thanks for your help, using the lime command is exactly what I needed to do.