-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (47 loc) · 1.07 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
.PHONY: build deps.get deps.upgrade compile lint test repl upload clean
all: help
help:
@echo "Usage: make <target>"
@echo "Targets:"
@echo " build - Build the project"
@echo " deps.get - Install dependencies"
@echo " deps.upgrade - Upgrade dependencies"
@echo " deps.purge - Purge dependencies"
@echo " compile - Compile the project"
@echo " lint - Lint the code"
@echo " test - Run tests"
@echo " repl - Start an interactive Elixir shell"
@echo " upload - Publish the project to Hex"
@echo " clean - Clean the project"
########### Elixir #########
# 构建项目
build: clean deps.get compile
deps.get:
@mix deps.get
@echo "Dependencies installed."
deps.upgrade:
@mix deps.update --all
@echo "Dependencies updated."
deps.purge:
@rm -rf deps
@rm -rf _build
@echo "Dependencies purged."
compile:
@mix compile
# 代码质量检查
lint:
@mix format --check-formatted
# 格式化代码
fmt:
@mix format
# 运行测试
test:
@mix test
clean:
@mix clean
@echo "Cleaning complete."
# 交互式Elixir Shell
repl:
@iex -S mix
upload:
@mix hex.publish