Closed j-jzk closed 11 months ago
Thanks! I think this can be merged once the above points have been handled
Hopefully I will finish this till the end of the week.
This PR is now ready as far as I'm concerned. Will wait a bit before merging in case someone has some argument against it.
Thanks for all the work :) Just sat down to work on this and saw you'd already finished it (much better than I would have).
Hope it still matches your workflow! Changed into a file arg so that windows people don't freak out :sweat_smile:
@Simn is it ok to merge this? Documentation will wait a bit (for a new haxelib release), and can be done on a separate PR.
This PR adds two new commands:
haxelib state save haxelib-lock.hxml
haxelib state load haxelib-lock.hxml
This manifest file (note that
.hxml
extension isn't mandatory here) is used to "lock" the current state of the libraries in the project. This is useful for reproducing the exact state of dependencies in a project (on a new machine or in Docker), especially when working with libraries installed from git.The intended workflow is following:
haxelib state save haxelib-lock.hxml
haxelib state load haxelib-lock.hxml
This manifest mechanism supports published haxelib versions, as well as exact git and mercurial references.
haxelib dev
libs are ignored (with a warning), and try to resolve to "non-dev" version for the manifest file, allowing you to work with dev libs locally without altering the pin file.I switched to file output instead of stdout for better cross-platform support, and API consistency. "manifest" terminology comes from https://learn.microsoft.com/en-us/vcpkg/users/manifests
Original PR description below:
This PR adds a new lock command which, as in other library managers, "locks" the current state of the libraries in the project. This is useful for reproducing the exact state of dependencies in a project (on a new machine or in Docker), especially when working with libraries installed from git.
The output is in HXML (
-L lib:version ...
) and it is dumped to stdout instead of a file. The intended workflow is following:haxelib lock > haxelib-lock.hxml
haxelib install --skip-dependencies --always haxelib-lock.hxml
I've created this for my personal usage and providing this patch hoping it could be useful to more developers. If inappropriate, feel free to add notes/close the PR. Before merging, support for locking versions of Mercurial libs (installed using
haxelib hg ...
) should be added. I am not a Mercurial user myself, so help would be greatly appreciated.