Question

I would like to know if that's possible to declare a dependency to a library via GIT. My usecase is simple, I have some tools, that I would like to share between my projects, but I don't want to add them to haxelib (because this tools are not really interesting for someone else). Otherwise, I would like that people who will install my lib, get my tools too (without the need to use manually haxelib git ....).

Is it possible ? (I didn't read anything about that in documentation)

Was it helpful?

Solution

This is currently not supported in Haxelib, though it would be great to see, and not too hard to implement. If you're interested in working on Haxelib, it's not too hard, open an Issue on the Haxelib Github project and perhaps we can help you figure out how to contribute.

One alternative if you need a workaround is to create a "run" script, so you can do:

# Run the project's run.n file
haxelib run mylib   

# Your "run.n" file could have a "setup" command that runs 
# the "haxelib git" commands for the user
haxelib run mylib setup  

It's a bit of a hack, but it could work in the interim. See http://haxe.org/doc/haxelib/using_haxelib#runnable-project for more info on how to have a run script for your haxelib.

OTHER TIPS

As of 2016, this is now natively supported by Haxelib. You can see the PR here.

As mentioned in the PR, you can use the one of these two:

  • haxelib git:<url> (similar to cloning the git repository).
  • haxelib git:<url>#commit-ish (clones to a specific commit, specify the hash.

Shameless plug, BUT you can checkout my http://lib.haxe.org/p/hxmlinstall/
1. Add -lib hxmlinstall to your hxml.
2. Annotate your tools like so

#git https://github.com/you/tools commithash
-lib forkedlib:git

On build you will be warned if your lib repository is not on specified %commithash%
Run haxelib run hxmlinstall to install / pull / update all dependencies

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top