-
Place
lix-to-install
andlix-to-haxelib
in a directory being in your$PATH
(~/.bin
for example, which you may have to add to your$PATH
) and chmod them withchmod +x
. -
Generate a
install.hxml
file by running this in your project:lix-to-install > install.hxml
-
Install dependencies via haxelib (needs HaxeFoundation/haxelib#456):
haxelib install --skipdeps --always install.hxml
Created
June 2, 2019 14:38
-
-
Save kLabz/e29722b3425ad2f36341d86d3612c117 to your computer and use it in GitHub Desktop.
[Haxe] Use lix projects without lix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# TODO: handle other install types | |
HAXELIB_VERSION=$(cat $1 | grep 'lix --silent download "haxelib:' | cut -d '"' -f 2 | cut -d ':' -f 2 | sed 's/#/:/' | sed 's,/,,') | |
if [ ! -z $HAXELIB_VERSION ]; then | |
echo "-lib $HAXELIB_VERSION" | |
else | |
LIB_NAME=$(basename -s .hxml $1) | |
GIT_URL=$(cat $1 | grep 'lix --silent download "gh:' | cut -d '"' -f 2 | sed 's/#/.git#/' | sed 's,gh://github.com/,git@github.com:,') | |
if [ -z $GIT_URL ]; then | |
GIT_URL=$(cat $1 | grep 'lix --silent download "https://github.com' | cut -d '"' -f 2 | sed 's,/archive/,.git#,' | sed 's,https://github.com/,git@github.com:,' | sed 's/.tar.gz//') | |
fi | |
if [ -z $GIT_URL ]; then | |
echo "# error: cannot find version for $LIB_NAME" | |
else | |
echo "-lib $LIB_NAME:git:$GIT_URL" | |
fi | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ ! -e haxe_libraries ]; then | |
echo "Cannot find haxe_libraries; aborting." | |
exit 1 | |
fi | |
find haxe_libraries/*.hxml | xargs -n 1 lix-to-haxelib |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I might move these to https://github.com/kLabz/haxe-manager (in
extra
) if/when my PR on haxelib gets merged and released.