-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
86 lines (68 loc) · 2.13 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.PHONY: default clean build test coverage
.PHONY: init init-promote init-relaxed init-ci
.PHONY: setup setup-ocaml setup-git
.PHONY: post-init by-dune
.PHONY: ci-prepare ci-build ci-test
.PHONY: pack-main-entry serve-main-entry dev-main-entry
.PHONY: pack
default: node_modules build test coverage
setup: setup-git setup-ocaml
setup-git:
git submodule update --init
setup-ocaml:
opam install . -y --deps-only --with-test --with-doc
pack: pack-main-entry
pack-main-entry: apps/main-entry/dist/main-entry-bundle.tar.gz
build: pack
test:
dune runtest -f --no-buffer
coverage:
rm -rf _coverage
-dune runtest -f --instrument-with bisect_ppx --no-buffer
@(cd _build/default && \
mkdir -p _coverage/ocaml/coverage-files && \
find . | grep -E 'bisect.+[.]coverage$$' | xargs -I{} cp {} _coverage/ocaml/coverage-files)
@(cd _build/default && \
bisect-ppx-report html -o _coverage/ocaml _coverage/ocaml/coverage-files/*)
-(cd _build/default && npx jest --coverage)
@echo ">>> OCaml coverage:"
@(cd _build/default && \
bisect-ppx-report summary _coverage/ocaml/coverage-files/*)
cp -aP _build/default/_coverage _coverage
post-init:
rm -rf node_modules
cp -aP _build/default/node_modules/ node_modules/
ci-prepare: setup-ocaml init-ci
ci-build: build pack
ci-test: test coverage
init:
dune build @init
$(MAKE) post-init
init-promote:
dune build @init --auto-promote
$(MAKE) post-init
init-relaxed:
PURE_LOCKFILE=true dune build @init
$(MAKE) post-init
init-ci:
FROZEN_LOCKFILE=true dune build @init
$(MAKE) post-init
clean:
@echo dune build @clean
@dune build @clean || echo "info: dune build @clean failed but not a problem"
@echo dune clean
@dune clean || echo "info: dune clean failed but not a problem"
rm -rf _dist
rm -rf _build
rm -rf _coverage
rm -rf node_modules
serve-main-entry: pack-main-entry by-dune
dune build @fresh-serve apps/main-entry --no-buffer --display quiet
dev-main-entry: by-dune
dune build apps/main-entry/_serve
dune build -w @serve apps/main-entry --no-buffer
apps/main-entry/dist/main-entry-bundle.tar.gz: by-dune
dune build @pack apps/main-entry/dist --no-buffer
node_modules:
$(MAKE) init
by-dune: