Currently haxelib has two ways to have project local setups.
haxelib newrepo
haxelib install all
When using haxelib newrepo
you can have a project-local haxelib repository.
Caveats:
Haxe allows you to define specific versions of the libraries you want to use with --library <libname>:<version>
. If you make sure to use this in all your hxmls, then haxelib install all --always
(the --always
avoiding you being prompted for confirmation) will be able to ensure the libraries your project needs are available in the necessary versions. If in fact you run this in a checkout hook, your get to track your dependencies in your git repo (some other VCSs should allow for a similar setup), allowing you to have a well defined and replicable setup for any state (commit/branch/etc.).
Disadvantages:
haxelib install all
to grab themhaxelib install all
may set the global "current" version of the libraries (to be fixed)Advantages:
You can specify git versions with --library libname:git:https://github.com/user/repo#branch
branch can be a branch or a specific commit SHA.
As alternative, you might use git submodules instead, they also provide an adequate way of definining a versionable and replicable state.
You can of course combine both approaches, giving you the isolation provided by the first one, and the replicability provided by the second one.
A solution that combines the strengths of both approaches is in the making. Stay tuned.
Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!
Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.