forked from ocamllabs/vscode-ocaml-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (70 loc) · 1.97 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
.DEFAULT_GOAL := all
.PHONY: all
all:
dune build --root .
.PHONY: yarn-deps
yarn-deps:
yarn --frozen-lockfile
yarn --frozen-lockfile --cwd astexplorer
.PHONY: deps
deps: ## Install development dependencies
opam install -y ocamlformat.0.25.1 ocaml-lsp-server $(DEV_DEPS)
$(MAKE) yarn-deps
opam install --deps-only --with-test --with-doc -y .
.PHONY: create_switch
create_switch:
opam switch create . 4.14.0 --no-install
.PHONY: switch
switch: create_switch deps ## Create an opam switch and install development dependencies
.PHONY: build
build: ## Build the project
dune build src/vscode_ocaml_platform.bc.js
yarn --cwd astexplorer build
yarn esbuild _build/default/src/vscode_ocaml_platform.bc.js \
--bundle \
--external:vscode \
--outdir=dist \
--platform=node \
--target=es6 \
--sourcemap
.PHONY: build-release
build-release:
dune build src/vscode_ocaml_platform.bc.js --profile=release
yarn --cwd astexplorer build
yarn esbuild _build/default/src/vscode_ocaml_platform.bc.js \
--bundle \
--external:vscode \
--outdir=dist \
--platform=node \
--target=es6 \
--minify-whitespace \
--minify-syntax \
--sourcemap \
--sources-content=false
.PHONY: test
test: ## Run the unit tests
dune build --root . @runtest
yarn test
.PHONY: clean
clean: ## Clean build artifacts and other generated files
dune clean --root .
rm -r dist/
.PHONY: doc
doc: ## Generate odoc documentation
dune build --root . @doc
.PHONY: fmt
fmt: ## Format the codebase with ocamlformat
dune build --root . --auto-promote @fmt
yarn fmt
.PHONY: watch
watch: ## Watch for the filesystem and rebuild on every change
dune build @all -w --terminal-persistence=clear-on-rebuild
.PHONY: pkg
pkg: build # Builds and packages the extension for installment
yarn vsce package --out ./test_extension.vsix
.PHONY: install
install: pkg # Builds, packages, and installs the extension to your VS Code
code --force --install-extension test_extension.vsix
.PHONY:
nix-tests:
dune build @runtest @all