-
Notifications
You must be signed in to change notification settings - Fork 71
/
Makefile
85 lines (70 loc) · 1.93 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
.PHONY: npm-deps
npm-deps:
yarn install --immutable
.PHONY: deps
deps: ## Install development dependencies
$(MAKE) npm-deps
opam install --deps-only --with-test --with-doc --with-dev-setup --yes .
.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 workspace astexplorer build
yarn esbuild _build/default/src/vscode_ocaml_platform.bc.js \
--bundle \
--packages=bundle \
--external:vscode \
--outdir=dist \
--platform=node \
--target=es2022 \
--sourcemap
.PHONY: build-release
build-release:
dune build src/vscode_ocaml_platform.bc.js --profile=release
yarn workspace astexplorer build
yarn esbuild _build/default/src/vscode_ocaml_platform.bc.js \
--bundle \
--packages=bundle \
--external:vscode \
--outdir=dist \
--platform=node \
--target=es2022 \
--minify-whitespace \
--minify-syntax \
--sourcemap \
--sources-content=false
.PHONY: test
test: ## Run the unit tests
dune build @runtest
yarn test
.PHONY: clean
clean: ## Clean build artifacts and other generated files
dune clean
rm -r dist/
.PHONY: doc
doc: ## Generate odoc documentation
dune build @doc
.PHONY: fmt
fmt: ## Format the codebase with ocamlformat
dune build --auto-promote @fmt
yarn biome format --write
.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 --no-dependencies
.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