Skip to content

Commit 4c96d10

Browse files
committed
[feature] prepare formal npm release (#355)
* [feature] prepare formal npm release * [fix] install issues * tweak makefile * [snapshot] and add env variables for CI * ready for publish * [fix] ignore files from travis ci, no bin for bsc since it requires its existence before post-install * [done] * [tweak] use specialized env, replace the shell with js file later * [tweak] * [tweak]
1 parent fbe7024 commit 4c96d10

File tree

9 files changed

+987
-815
lines changed

9 files changed

+987
-815
lines changed

.gitignore

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ _build
99
*.cmx
1010
*.cmt
1111
*.cmti
12-
jslambda
12+
*.cma
13+
*.a
14+
*.cmxa
15+
1316

1417
exports.js
1518
*.lambda
@@ -69,4 +72,17 @@ coverage
6972
dist/
7073

7174
bin/
72-
man/
75+
man/
76+
lib/ocaml/*.ml
77+
lib/ocaml/*.mli
78+
lib/ocaml/caml
79+
lib/ocaml/VERSION
80+
lib/ocaml/camlheader
81+
lib/ocaml/camlheader_ur
82+
lib/ocaml/expunge
83+
lib/ocaml/ld.conf
84+
lib/ocaml/objinfo_helper
85+
lib/ocaml/vmthreads/
86+
lib/ocaml/Makefile.config
87+
lib/ocaml/extract_crc
88+

.travis-ci-before-script.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

.travis-ci.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
set -e
3+
4+
if [ $BS_TRAVIS_CI ]
5+
then
6+
git submodule update --init --recursive
7+
fi
8+
9+
export OCAMLPARAM='_,bin-annot=1'
10+
export OCAMLRUNPARAM=b
11+
12+
# we encoruage people to install from opam
13+
# for our own local installation
14+
# it can be minimal
15+
cd ocaml && ./configure -prefix $(dirname $(pwd)) -no-ocamldoc -no-ocamlbuild -no-shared-libs -no-curses -no-graph -no-pthread -no-debugger && make -j9 world.opt && make install && cd ..
16+
17+
# we should not rely on git
18+
# it will break `npm postinstall`
19+
# if [ ! $BS_TRAVIS_CI ]
20+
# then
21+
# cd ocaml && git clean -dfx && cd ..
22+
# fi
23+
24+
export PATH=$(pwd)/bin:$PATH
25+
26+
cd jscomp && make travis-world-test && make install

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
language: node_js
22
env:
33
- OCAML=4.02.3
4+
- BS_TRAVIS_CI=1
45
node_js:
56
- "4.0"
67

7-
before_script: bash -ex .travis-ci-before-script.sh
8-
98
script: npm run coveralls
109

jscomp/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ travis-world-test:./bin/ocaml_pack
128128
@echo "Generating the compiler finished"
129129
make world-test
130130

131+
# no depend on ./bin/ocaml_pack ./bin/bsc
132+
# since in npm mode, they are generated from a single file
133+
install:
134+
cp ./bin/ocaml_pack ./bin/bsc ../bin/
135+
cp ./runtime/*.cmt* ../lib/ocaml/
136+
cp ./runtime/*.cmj* ../lib/ocaml/
137+
cp ./stdlib/*.cm* ../lib/ocaml/
138+
131139
.PHONY: stdlib
132140
.PHONY: test quicktest release snapshot snapshotcmj
133141

0 commit comments

Comments
 (0)