2016-02-19 16:36:03 -08:00
|
|
|
# Portions Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
2016-03-03 07:59:12 +01:00
|
|
|
|
2016-05-22 01:23:48 +03:00
|
|
|
SHELL=bash -o pipefail
|
2016-05-09 14:08:55 -07:00
|
|
|
|
2017-11-01 00:42:39 -07:00
|
|
|
default: build
|
2016-03-03 07:59:12 +01:00
|
|
|
|
2017-10-30 22:40:16 -07:00
|
|
|
build:
|
2018-08-20 21:30:20 +01:00
|
|
|
dune build
|
2016-02-19 16:36:03 -08:00
|
|
|
|
|
|
|
|
install:
|
|
|
|
|
opam pin add reason . -y
|
|
|
|
|
|
2017-11-01 14:50:32 -07:00
|
|
|
# CI uses opam. Regular workflow needn't.
|
|
|
|
|
test-ci: install test
|
|
|
|
|
|
2017-10-30 22:40:16 -07:00
|
|
|
test: build clean-tests
|
2018-10-02 02:17:24 -07:00
|
|
|
dune build src/reason-parser-tests/testOprint.exe
|
2018-04-28 15:39:08 -07:00
|
|
|
# ./miscTests/rtopIntegrationTest.sh
|
2016-09-23 20:00:09 -07:00
|
|
|
./miscTests/jsxPpxTest.sh
|
2016-02-19 16:36:03 -08:00
|
|
|
cd formatTest; ./test.sh
|
|
|
|
|
|
2018-01-31 22:13:55 +11:00
|
|
|
.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 {} \;
|
|
|
|
|
|
2016-12-12 20:39:02 -08:00
|
|
|
clean-tests:
|
|
|
|
|
rm -rf ./formatTest/**/actual_output
|
2018-10-08 21:07:45 +01:00
|
|
|
rm -rf ./formatTest/**/intf_output
|
|
|
|
|
rm -rf ./formatTest/**/**/TestTest.cmi
|
2016-12-12 20:39:02 -08:00
|
|
|
rm -f ./formatTest/failed_tests
|
2017-09-06 18:38:33 -07:00
|
|
|
rm -f ./miscTests/reactjs_jsx_ppx_tests/*.cm*
|
2016-12-12 20:39:02 -08:00
|
|
|
|
2017-11-04 20:52:16 +01:00
|
|
|
testFormat: build clean-tests
|
|
|
|
|
cd formatTest; ./test.sh
|
|
|
|
|
|
2018-05-31 07:45:47 +02:00
|
|
|
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
|
|
|
|
|
|
2016-12-12 20:39:02 -08:00
|
|
|
clean: clean-tests
|
2018-08-20 21:30:20 +01:00
|
|
|
dune clean
|
2017-11-01 01:46:19 -07:00
|
|
|
|
|
|
|
|
clean-for-ci: clean-tests
|
2017-10-31 23:56:41 -07:00
|
|
|
rm -rf ./_build
|
2016-02-19 16:36:03 -08:00
|
|
|
|
2017-03-22 17:36:47 -07:00
|
|
|
.PHONY: build clean
|
2016-02-19 16:36:03 -08:00
|
|
|
|
2016-10-03 00:20:19 -07:00
|
|
|
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
|
|
|
|
SUBSTS:=$(ROOT_DIR)/pkg/substs
|
|
|
|
|
|
2018-01-25 01:11:18 -08:00
|
|
|
# For publishing esy releases to npm
|
2018-03-07 04:22:57 -08:00
|
|
|
esy-prepublish: build clean-tests pre_release
|
2018-01-25 01:11:18 -08:00
|
|
|
node ./scripts/esy-prepublish.js
|
|
|
|
|
|
|
|
|
|
# For OPAM
|
2017-01-27 09:55:12 -08:00
|
|
|
pre_release:
|
2016-10-03 00:20:19 -07:00
|
|
|
ifndef version
|
2017-03-22 17:36:47 -07:00
|
|
|
$(error environment variable 'version' is undefined)
|
2016-10-03 00:20:19 -07:00
|
|
|
endif
|
2017-01-19 15:35:31 -08:00
|
|
|
export git_version="$(shell git rev-parse --verify HEAD)"; \
|
|
|
|
|
export git_short_version="$(shell git rev-parse --short HEAD)"; \
|
2017-12-28 16:32:54 +08:00
|
|
|
$(SUBSTS) $(ROOT_DIR)/src/refmt/package.ml.in
|
2017-01-19 15:35:31 -08:00
|
|
|
|
2017-01-27 09:55:12 -08:00
|
|
|
.PHONY: pre_release
|
2017-01-19 15:35:31 -08:00
|
|
|
|
2018-01-25 01:11:18 -08:00
|
|
|
# For OPAM
|
2017-02-21 14:39:00 -08:00
|
|
|
release_check:
|
2017-02-27 10:00:06 -08:00
|
|
|
./scripts/release-check.sh
|
2017-02-21 14:39:00 -08:00
|
|
|
|
2018-01-25 01:11:18 -08:00
|
|
|
# For OPAM
|
2017-02-21 14:39:00 -08:00
|
|
|
release: release_check pre_release
|
2017-11-27 14:01:28 -08:00
|
|
|
git add package.json src/refmt/package.ml reason.opam
|
2016-10-03 00:20:19 -07:00
|
|
|
git commit -m "Version $(version)"
|
|
|
|
|
git tag -a $(version) -m "Version $(version)."
|
2017-03-28 11:45:57 -07:00
|
|
|
# Push first the objects, then the tag.
|
|
|
|
|
git push "git@github.com:facebook/Reason.git"
|
2017-03-10 16:52:13 -08:00
|
|
|
git push "git@github.com:facebook/Reason.git" tag $(version)
|
2016-10-16 11:12:24 -07:00
|
|
|
git clean -fdx
|
2017-03-22 17:36:47 -07:00
|
|
|
./scripts/opam-release.sh
|
2016-02-19 16:36:03 -08:00
|
|
|
|
|
|
|
|
.PHONY: release
|
2017-11-02 12:24:33 +08:00
|
|
|
|
|
|
|
|
all-supported-ocaml-versions:
|
|
|
|
|
# the --dev flag has been omitted here but should be re-introduced eventually
|
2018-08-20 21:30:20 +01:00
|
|
|
dune build @install @runtest --root .
|
2017-11-02 12:24:33 +08:00
|
|
|
|
|
|
|
|
.PHONY: all-supported-ocaml-versions
|