Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
Add bucklescript
Browse files Browse the repository at this point in the history
and ninja
  • Loading branch information
chenglou committed Feb 11, 2017
1 parent bf013a9 commit 76b3ab5
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .bin/bsb
Original file line number Diff line number Diff line change
@@ -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 "$@"
17 changes: 17 additions & 0 deletions .bin/ninja
Original file line number Diff line number Diff line change
@@ -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 "$@"
2 changes: 2 additions & 0 deletions actualInstall/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*"
}
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 6 additions & 0 deletions performActualInstallAndFixLinks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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

0 comments on commit 76b3ab5

Please sign in to comment.