diff --git a/.bin/bsb b/.bin/bsb new file mode 100755 index 0000000..183c0a4 --- /dev/null +++ b/.bin/bsb @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# This could likely be replaced with an included `realpath` implementation +# ---------------------------------------------------------------------- +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$SCRIPTDIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +# Now simply call the actual `bsb` implementation, forwarding args, +# but making sure we have the right environment setup. +# ---------------------------------------------------------------------- +cd $SCRIPTDIR/../actualInstall +../node_modules/.bin/esy bsb "$@" diff --git a/.bin/ninja b/.bin/ninja new file mode 100755 index 0000000..903934e --- /dev/null +++ b/.bin/ninja @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# This could likely be replaced with an included `realpath` implementation +# ---------------------------------------------------------------------- +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$SCRIPTDIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +# Now simply call the actual `ninja` implementation, forwarding args, +# but making sure we have the right environment setup. +# ---------------------------------------------------------------------- +cd $SCRIPTDIR/../actualInstall +../node_modules/.bin/esy ninja "$@" diff --git a/actualInstall/package.json b/actualInstall/package.json index 9f0517f..153f158 100644 --- a/actualInstall/package.json +++ b/actualInstall/package.json @@ -27,6 +27,8 @@ "dependencies": { "reason": "facebook/reason#esy", "ocaml": "esy-ocaml/ocaml#esy", + "bs-platform": "esy-ocaml/bucklescript#esy", + "ninja-build-system": "reasonml/ninja.git#v1.7.2-esy", "@opam-alpha/merlin": "*", "@opam-alpha/utop": "*" } diff --git a/package.json b/package.json index 8abecab..4cc0b67 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,9 @@ "refmttype": "./.bin/refmttype", "reopt": "./.bin/reopt", "rebuild": "./.bin/rebuild", - "ocamlmerlin": "./.bin/ocamlmerlin" + "ocamlmerlin": "./.bin/ocamlmerlin", + "bsb": "./.bin/bsb", + "ninja": "./.bin/ninja" }, "homepage": "https://github.com/reasonml/reason-cli#readme", "dependencies": { diff --git a/performActualInstallAndFixLinks.sh b/performActualInstallAndFixLinks.sh index de30363..bc2580c 100755 --- a/performActualInstallAndFixLinks.sh +++ b/performActualInstallAndFixLinks.sh @@ -18,6 +18,8 @@ rm ./.bin/refmt rm ./.bin/refmttype rm ./.bin/refmt_merlin rm ./.bin/reopt +rm ./.bin/bsb +rm ./.bin/ninja cd ./actualInstall/ && ../node_modules/.bin/esy install && ../node_modules/.bin/esy build @@ -34,6 +36,8 @@ REFMT_DEST=`../node_modules/.bin/esy which refmt` REFMTTYPE_DEST=`../node_modules/.bin/esy which refmttype` REFMT_MERLIN_DEST=`../node_modules/.bin/esy which refmt_merlin` REOPT_DEST=`../node_modules/.bin/esy which reopt` +BSB_DEST=`../node_modules/.bin/esy which bsb` +NINJA_DEST=`../node_modules/.bin/esy which ninja` cd ../ ln -s $OCAMLMERLIN_REASON_DEST ./.bin/ocamlmerlin-reason @@ -49,3 +53,5 @@ ln -s $REFMT_DEST ./.bin/refmt ln -s $REFMTTYPE_DEST ./.bin/refmttype ln -s $REFMT_MERLIN_DEST ./.bin/refmt_merlin ln -s $REOPT_DEST ./.bin/reopt +ln -s $BSB_DEST ./.bin/bsb +ln -s $NINJA_DEST ./.bin/ninja