This repository was archived by the owner on Mar 28, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (38 loc) · 1.35 KB
/
Makefile
File metadata and controls
50 lines (38 loc) · 1.35 KB
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
.DEFAULT_GOAL := help
VERSION := $(shell cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="lindera-wasm") | .version')
clean: ## Clean the project
cargo clean
rm -rf pkg
rm -rf lindera-wasm/dist
rm -rf lindera-wasm/node_modules
format: ## Format the project
cargo fmt
lint: ## Lint the project
cargo clippy --all-features
test: ## Test the project
wasm-pack test --node --all-features
build: ## Build the project
wasm-pack build --release --all-features --target=web
publish: ## Publish the project
wasm-pack publish --access=public --target=web
build-example: ## Build the example application
wasm-pack build --release --features=embed-ipadic --target=web && \
cd lindera-wasm && \
jq '.version = "$(VERSION)"' ./package.json > ./temp.json && mv ./temp.json ./package.json && \
npm install && \
npm run build && \
cp index.html dist/index.html
run-example: ## Run the example application
cd lindera-wasm && npm run start
clean-example: ## Clean the example application
cd lindera-wasm && \
rm -rf dist && \
rm -rf node_modules && \
rm -rf package-lock.json && \
rm -rf temp.json
tag: ## Make a tag
git tag v$(VERSION)
git push origin v$(VERSION)
help: ## Show help
@echo "Available targets:"
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-15s %s\n", $$1, $$2}'