Open jerrygreen opened 3 years ago
You can also haxelib install install.hxml
with install.hxml
containing specific versions:
# from haxelib
-lib js-object:0.0.7
# from git
-lib some-lib:git:git@github.com:user/some-repo.git
# from git with reference (branch, tag, commit hash..)
-lib other-lib:git:git@github.com:user/repo.git#281f723e
I personnally add --skip-dependencies
to haxelib command and add dependencies to this install.hxml
myself to be able to pin their versions too.
See also https://github.com/HaxeFoundation/haxe/wiki/Haxe-haxec-haxelib-plan for future plans.
Edit: haxelib.json
was meant for libs, not for projects, and that doesn't seem to be really open for change
Actually, that is a handy thing. I suspected something like that is possible, even tried -lib js-object@0.0.7
(@ symbol), but it didn't work. Neither I found any info about versions in docs.
I've just noticed it's shown in schema hint though:
But what's about --skip-dependencies
? How do you use it?
It prevents haxelib from installing dependencies of libraries I install, because I cannot pin their versions (the libraries might pin their dependencies' versions but that may not be what I want either). So I add my libraries' dependencies myself in install.hxml
too
@kLabz yeah, I understand meaning of install.hxml
, - that's pretty handy. You run something like haxelib install install.hxml
, right?
I don't get where do you get benefit of using --skip-dependencies
My previous message was entirely about --skip-dependencies
flag
@kLabz oh shi, it's for DEPENDENCIES of your DEPENDENCIES... I got it now. I'm ~just not very smart~ awake around 24hr already, and struggled to figure out why would you skip dependencies while you're installing dependencies.
Actually, that is a handy thing. I suspected something like that is possible, even tried -lib js-object@0.0.7 (@ symbol), but it didn't work. Neither I found any info about versions in docs.
I too was just trying to pin my dependency versions and didn't find the syntax for -lib <library>:<version>
in the docs!
Turns out it's not explained on this page but it IS on this one. Which I do find confusing. I actually found it in kLabz's example here first.
There's already a command:
What it does: it reads current folder for
.hxml
files, lookups-lib
flags, and installs all these libs with the latest versions. Which is quite handy at first, but it has two cons:I came from JS/TS world, and kinda expected
haxelib install
to install all versions taken from dependency list fromhaxelib.json
, but it seems norhaxelib install
, norhaxelib install all
doesn't work this way.I personally don't have a problem with it, since I can just list those dependencies in a file like
install.sh
:And then just run
./install.sh
in terminal anytime later so even if some time will pass, it will be possible to setup the project with just one command, and not meet dozens of errors. But unfortunately there's no guideline or something like that, so I see some projects or examples like these:https://github.com/Beeblerox/Simplest-Heaps-Examples
Which is quite a lot of work, but kinda useless work, because those examples just don't work with modern versions, and it's not possible to see them in action.
My proposal
haxelib install
to read dependencies fromhaxelib.json
, install em with specified versionshaxelib install heaps
to add the latest version of heaps intohaxelib.json
(and create one, if needed)haxelib install all
❔