Skip to content

Commit 785fb26

Browse files
committed
[clean] clean up dist (#358)
* [clean] clean up dist * update depends in test dir and add a dummy bin/bsc for npm * tweak * also encode package name in [cmj] files * [snapshot] * [fix] Sys.is_directory can throw * [feature] change resolution rules when compilation unit does not have package specified, while its dependency has * tweak
1 parent 4ba45da commit 785fb26

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+569
-1518
lines changed

.gitignore

Lines changed: 21 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -12,72 +12,46 @@ _build
1212
*.cma
1313
*.a
1414
*.cmxa
15-
16-
17-
exports.js
15+
*~
16+
*.annot
17+
*.mj
18+
*.bak
19+
.vscode
20+
*.jsx
1821
*.lambda
1922
*.rawlambda
20-
node_modules
2123
*.o
2224
*.lam
23-
err.log
24-
.idea
25-
ocaml_pack
2625
*.0.js
27-
*~
28-
stdlib/c.js
29-
*.map
3026
*#
31-
qcc/
27+
*.log
3228
.#*
33-
# jscomp/stdlib/external/*.js
34-
oxml
3529
*.cmj
36-
3730
*.rawlambda
3831
*.lambda
39-
40-
41-
ocaml/
42-
43-
44-
test.json
45-
*~
46-
*.annot
47-
*.mj
48-
49-
*.bak
50-
.vscode
51-
*.jsx
32+
*.zip
33+
*.gz
34+
# special file
35+
ocaml_pack
5236
bsc
5337
bscc
54-
5538
ocaml_pack0.ml
5639
ocaml_pack1.ml
57-
58-
40+
.idea
41+
exports.js
42+
node_modules
43+
oxml
44+
test.json
5945
jscomp/pre_load.js
6046
boot
6147
*.dump
62-
6348
coverage
64-
*.log
65-
./jscomp/output
6649
*.g.js
6750
dist/
68-
69-
bin/
7051
man/
71-
lib/ocaml/*.ml
72-
lib/ocaml/*.mli
73-
lib/ocaml/caml
74-
lib/ocaml/VERSION
75-
lib/ocaml/camlheader
76-
lib/ocaml/camlheader_ur
77-
lib/ocaml/expunge
78-
lib/ocaml/ld.conf
79-
lib/ocaml/objinfo_helper
80-
lib/ocaml/vmthreads/
81-
lib/ocaml/Makefile.config
82-
lib/ocaml/extract_crc
52+
lib/ocaml
53+
bin/*
8354

55+
# for npm publish
56+
!bin/bsc
57+
!ocaml.tar.gz

.travis-ci.sh

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

bin/bsc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
echo "PLEASE RUN NPM POSTINSTALL TO GET BSC BINARY"
3+
exit 2

jscomp/Makefile

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,18 @@ world:
7272
cd runtime && make all
7373
@echo "Making runtime finished"
7474

75-
@echo "Making stdlib"
76-
cd lib && make all
77-
@echo "Making stdlib finished"
7875

79-
@echo "Making lib"
76+
@echo "Making stdlib"
8077
cd stdlib && make all
81-
@echo "Making lib finished"
78+
@echo "Making stdlib finished"
8279

8380
# no depend on ./bin/ocaml_pack ./bin/bsc
8481
# since in npm mode, they are generated from a single file
8582
install:
8683
cp ./bin/bsc ../bin/
8784
cp ./runtime/*.cmt* ../lib/ocaml/
8885
cp ./runtime/*.cmj* ../lib/ocaml/
86+
cp ./runtime/js.cmi ./runtime/fn.cmi ../lib/ocaml/
8987
cp ./stdlib/*.cm* ../lib/ocaml/
9088

9189
TMP_OCAMLLIB=$(shell ocamlopt.opt -where)
@@ -101,12 +99,8 @@ big-world:bin/big_compiler.ml bin/big_compiler.mli
10199
@echo "Making runtime finished"
102100

103101
@echo "Making stdlib"
104-
cd lib && make all
105-
@echo "Making stdlib finished"
106-
107-
@echo "Making lib"
108102
cd stdlib && make all
109-
@echo "Making lib finished"
103+
@echo "Making stdlib finished"
110104

111105
world-test:
112106
@echo "Making compiler"
@@ -118,13 +112,9 @@ world-test:
118112
@echo "Making runtime finished"
119113

120114
@echo "Making stdlib"
121-
cd lib && make all
115+
cd stdlib && make all
122116
@echo "Making stdlib finished"
123117

124-
@echo "Making lib"
125-
cd stdlib && make all
126-
@echo "Making lib finished"
127-
128118
@echo "Making test"
129119
cd test && make all
130120
@echo "Making test finsihed"

jscomp/bin/compiler.ml

Lines changed: 207 additions & 104 deletions
Large diffs are not rendered by default.

jscomp/build.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
#!/bin/sh
22

33
set -e
4-
. ./env.sh
4+
5+
export OCAMLPARAM='_,bin-annot=1,annot=1'
6+
export OCAMLRUNPARAM=b
7+
export OCAMLBUILD_CFLAGS=-g,-w,-40-30,-warn-error,+a-40-30,-keep-locs,-I,+compiler-libs
8+
export npm_package_name=bs-platform
9+
510

611
## Only make sense for dev
712
make js_map.ml js_fold.ml >> build.compile
@@ -28,9 +33,6 @@ echo "Remaking standard library" >> build.compile
2833
cd ./stdlib; ./build.sh ; cd ../
2934
echo "Remaking standard library Finished" >> build.compile
3035

31-
echo "Remaking thirdparty library" >> build.compile
32-
cd ./lib; ./build.sh ; cd ../
33-
echo "Remaking thirdparty library Finished" >> build.compile
3436

3537
TARGET=a
3638

jscomp/compiler.mllib

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ ext_array
2626
ext_bytes
2727
ext_map
2828
ext_hashtbl
29+
ext_sys
30+
2931

3032
lam_mk
3133
lam_comb

jscomp/dist/.npmignore

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

0 commit comments

Comments
 (0)