-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "state save" and "state load" commands #610
Conversation
Thanks! |
Hopefully I will finish this till the end of the week. |
This PR is now ready as far as I'm concerned. |
Also write directly to file instead of stdout, and added 'pin apply' command as alias to 'install --always --skip-dependencies'
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 😅 |
@Simn is it ok to merge this? |
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.