From 2c795705ad1a78f7689f3b2c49897df9a819145b Mon Sep 17 00:00:00 2001 From: Sora Morimoto Date: Tue, 31 Dec 2024 08:54:28 +0900 Subject: [PATCH] Update Makefile Signed-off-by: Sora Morimoto --- .editorconfig | 3 +++ Makefile | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.editorconfig b/.editorconfig index c6c8b3621..730d51b8b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,3 +7,6 @@ end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true + +[Makefile] +indent_style = tab diff --git a/Makefile b/Makefile index 3d7e70359..871d3eed2 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ npm-deps: yarn install --immutable .PHONY: deps -deps: ## Install development dependencies +deps: $(MAKE) npm-deps opam install --deps-only --with-test --with-doc --with-dev-setup --yes . @@ -21,7 +21,7 @@ create_switch: switch: create_switch deps ## Create an opam switch and install development dependencies .PHONY: build -build: clean ## Build the project +build: ## https://github.com/ewanharris/vscode-versions dune build src/vscode_ocaml_platform.bc.js --profile=release yarn workspace astexplorer build yarn esbuild _build/default/src/vscode_ocaml_platform.bc.js \ @@ -31,38 +31,38 @@ build: clean ## Build the project --outdir=dist \ --packages=bundle \ --platform=node \ - --target=es2022 \ + --target=node22 \ --analyze .PHONY: test -test: ## Run the unit tests +test: dune build @runtest yarn test .PHONY: clean -clean: ## Clean build artifacts and other generated files +clean: dune clean $(RM) -r astexplorer/dist dist .PHONY: doc -doc: ## Generate odoc documentation +doc: dune build @doc .PHONY: fmt -fmt: ## Format the codebase with ocamlformat +fmt: dune build --auto-promote @fmt yarn biome format --write .PHONY: watch -watch: ## Watch for the filesystem and rebuild on every change +watch: dune build @all -w --terminal-persistence=clear-on-rebuild .PHONY: pkg -pkg: build # Builds and packages the extension for installment +pkg: clean build yarn package .PHONY: install -install: pkg # Builds, packages, and installs the extension to your VS Code +install: pkg code --force --install-extension ocaml-platform.vsix .PHONY: