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

Commit 76b3ab5

Browse files
committed
Add bucklescript
and ninja
1 parent bf013a9 commit 76b3ab5

5 files changed

Lines changed: 45 additions & 1 deletion

File tree

.bin/bsb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
# This could likely be replaced with an included `realpath` implementation
4+
# ----------------------------------------------------------------------
5+
SOURCE="${BASH_SOURCE[0]}"
6+
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
7+
SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
8+
SOURCE="$(readlink "$SOURCE")"
9+
[[ $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
10+
done
11+
SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
12+
13+
# Now simply call the actual `bsb` implementation, forwarding args,
14+
# but making sure we have the right environment setup.
15+
# ----------------------------------------------------------------------
16+
cd $SCRIPTDIR/../actualInstall
17+
../node_modules/.bin/esy bsb "$@"

.bin/ninja

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
# This could likely be replaced with an included `realpath` implementation
4+
# ----------------------------------------------------------------------
5+
SOURCE="${BASH_SOURCE[0]}"
6+
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
7+
SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
8+
SOURCE="$(readlink "$SOURCE")"
9+
[[ $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
10+
done
11+
SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
12+
13+
# Now simply call the actual `ninja` implementation, forwarding args,
14+
# but making sure we have the right environment setup.
15+
# ----------------------------------------------------------------------
16+
cd $SCRIPTDIR/../actualInstall
17+
../node_modules/.bin/esy ninja "$@"

actualInstall/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
"dependencies": {
2828
"reason": "facebook/reason#esy",
2929
"ocaml": "esy-ocaml/ocaml#esy",
30+
"bs-platform": "esy-ocaml/bucklescript#esy",
31+
"ninja-build-system": "reasonml/ninja.git#v1.7.2-esy",
3032
"@opam-alpha/merlin": "*",
3133
"@opam-alpha/utop": "*"
3234
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
"refmttype": "./.bin/refmttype",
3939
"reopt": "./.bin/reopt",
4040
"rebuild": "./.bin/rebuild",
41-
"ocamlmerlin": "./.bin/ocamlmerlin"
41+
"ocamlmerlin": "./.bin/ocamlmerlin",
42+
"bsb": "./.bin/bsb",
43+
"ninja": "./.bin/ninja"
4244
},
4345
"homepage": "https://github.com/reasonml/reason-cli#readme",
4446
"dependencies": {

performActualInstallAndFixLinks.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ rm ./.bin/refmt
1818
rm ./.bin/refmttype
1919
rm ./.bin/refmt_merlin
2020
rm ./.bin/reopt
21+
rm ./.bin/bsb
22+
rm ./.bin/ninja
2123

2224
cd ./actualInstall/ && ../node_modules/.bin/esy install && ../node_modules/.bin/esy build
2325

@@ -34,6 +36,8 @@ REFMT_DEST=`../node_modules/.bin/esy which refmt`
3436
REFMTTYPE_DEST=`../node_modules/.bin/esy which refmttype`
3537
REFMT_MERLIN_DEST=`../node_modules/.bin/esy which refmt_merlin`
3638
REOPT_DEST=`../node_modules/.bin/esy which reopt`
39+
BSB_DEST=`../node_modules/.bin/esy which bsb`
40+
NINJA_DEST=`../node_modules/.bin/esy which ninja`
3741

3842
cd ../
3943
ln -s $OCAMLMERLIN_REASON_DEST ./.bin/ocamlmerlin-reason
@@ -49,3 +53,5 @@ ln -s $REFMT_DEST ./.bin/refmt
4953
ln -s $REFMTTYPE_DEST ./.bin/refmttype
5054
ln -s $REFMT_MERLIN_DEST ./.bin/refmt_merlin
5155
ln -s $REOPT_DEST ./.bin/reopt
56+
ln -s $BSB_DEST ./.bin/bsb
57+
ln -s $NINJA_DEST ./.bin/ninja

0 commit comments

Comments
 (0)