forked from reasonml/reason
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
92 lines (70 loc) · 2.4 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
87
88
89
90
91
92
# Portions Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
SHELL=bash -o pipefail
default: build
build:
dune build
install:
opam pin add reason . -y
# CI uses opam. Regular workflow needn't.
test-ci: install test
test: build clean-tests
dune build src/reason-parser-tests/testOprint.exe
# ./miscTests/rtopIntegrationTest.sh
./miscTests/jsxPpxTest.sh
cd formatTest; ./test.sh
.PHONY: coverage
coverage:
find -iname "bisect*.out" -exec rm {} \;
make test
bisect-ppx-report -ignore-missing-files -I _build/ -html coverage-after/ bisect*.out ./*/*/*/bisect*.out
find -iname "bisect*.out" -exec rm {} \;
clean-tests:
rm -rf ./formatTest/**/actual_output
rm -rf ./formatTest/**/intf_output
rm -rf ./formatTest/**/**/TestTest.cmi
rm -f ./formatTest/failed_tests
rm -f ./miscTests/reactjs_jsx_ppx_tests/*.cm*
testFormat: build clean-tests
cd formatTest; ./test.sh
all_errors:
@ echo "Regenerate all the possible error states for Menhir."
@ echo "Warning: This will take a while and use a lot of CPU and memory."
@ echo "---"
menhir --explain --strict --unused-tokens src/reason-parser/reason_parser.mly --list-errors > src/reason-parser/reason_parser.messages.checked-in
clean: clean-tests
dune clean
clean-for-ci: clean-tests
rm -rf ./_build
.PHONY: build clean
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SUBSTS:=$(ROOT_DIR)/pkg/substs
# For publishing esy releases to npm
esy-prepublish: build clean-tests pre_release
node ./scripts/esy-prepublish.js
# For OPAM
pre_release:
ifndef version
$(error environment variable 'version' is undefined)
endif
export git_version="$(shell git rev-parse --verify HEAD)"; \
export git_short_version="$(shell git rev-parse --short HEAD)"; \
$(SUBSTS) $(ROOT_DIR)/src/refmt/package.ml.in
.PHONY: pre_release
# For OPAM
release_check:
./scripts/release-check.sh
# For OPAM
release: release_check pre_release
git add package.json src/refmt/package.ml reason.opam
git commit -m "Version $(version)"
git tag -a $(version) -m "Version $(version)."
# Push first the objects, then the tag.
git push "git@github.com:facebook/Reason.git"
git push "git@github.com:facebook/Reason.git" tag $(version)
git clean -fdx
./scripts/opam-release.sh
.PHONY: release
all-supported-ocaml-versions:
# the --dev flag has been omitted here but should be re-introduced eventually
dune build @install @runtest --root .
.PHONY: all-supported-ocaml-versions