Skip to content

Commit 5ab452b

Browse files
committed
migrate to melange + opam
1 parent 6177625 commit 5ab452b

File tree

77 files changed

+181
-4304
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+181
-4304
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ yarn-error.log*
99
*.bs.js
1010

1111
_esy
12+
_build
13+
_opam

Makefile

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
project_name = melange-atdgen-codec-runtime
2+
3+
DUNE = opam exec -- dune
4+
5+
.DEFAULT_GOAL := help
6+
7+
.PHONY: help
8+
help: ## Print this help message
9+
@echo "List of available make commands";
10+
@echo "";
11+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}';
12+
@echo "";
13+
14+
.PHONY: create-switch
15+
create-switch: ## Create opam switch
16+
opam switch create . 4.14.1 -y --deps-only
17+
18+
.PHONY: init
19+
init: create-switch install ## Configure everything to develop this repository in local
20+
21+
.PHONY: install
22+
install: ## Install development dependencies
23+
yarn
24+
opam update
25+
# Needed for melange-jest, only for development
26+
opam pin add melange-webapi.dev -y git+https://github.com/melange-community/melange-webapi.git#17a6998985253bca49602fc29ec8735f899458ae
27+
opam pin -y add $(project_name).dev . --working-dir
28+
29+
.PHONY: build
30+
build: ## Build the project
31+
$(DUNE) build @melange
32+
33+
.PHONY: build_verbose
34+
build_verbose: ## Build the project
35+
$(DUNE) build --verbose @melange
36+
37+
.PHONY: clean
38+
clean: ## Clean build artifacts and other generated files
39+
$(DUNE) clean
40+
41+
.PHONY: format
42+
format: ## Format the codebase with ocamlformat
43+
$(DUNE) build @fmt --auto-promote
44+
45+
.PHONY: format-check
46+
format-check: ## Checks if format is correct
47+
$(DUNE) build @fmt
48+
49+
.PHONY: watch
50+
watch: ## Watch for the filesystem and rebuild on every change
51+
$(DUNE) build --watch @melange
52+
53+
.PHONY: test
54+
test: ## Run the tests
55+
$(DUNE) build @runtest --no-buffer
56+
57+
.PHONY: test-watch
58+
test-watch: ## Run the tests and watch for changes
59+
$(DUNE) build -w @runtest

0 commit comments

Comments
 (0)