forked from valkey-io/valkey-glide
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
113 lines (90 loc) · 2.71 KB
/
Makefile
File metadata and controls
113 lines (90 loc) · 2.71 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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
.PHONY: all java java-test python python-test node node-test check-valkey-server go go-test prettier-check prettier-fix
BLUE=\033[34m
YELLOW=\033[33m
GREEN=\033[32m
RESET=\033[0m
ROOT_DIR=$(shell pwd)
PYENV_DIR=$(shell pwd)/python/.env
PY_PATH=$(shell find python/.env -name "site-packages"|xargs readlink -f)
PY_GLIDE_PATH=$(shell pwd)/python/python/
all: java java-test python python-test node node-test go go-test python-lint java-lint
##
## Java targets
##
java:
@echo "$(GREEN)Building for Java (release)$(RESET)"
@cd java && ./gradlew :client:buildAllRelease
java-lint:
@echo "$(GREEN)Running spotlessApply$(RESET)"
@cd java && ./gradlew :spotlessApply
java-test: check-valkey-server
@echo "$(GREEN)Running integration tests$(RESET)"
@cd java && ./gradlew :integTest:test
##
## Python targets
##
python:
@echo "$(GREEN)Building Python async + sync clients (release mode)$(RESET)"
@cd python && python3 dev.py build --mode release
python-lint:
@echo "$(GREEN)Running linters via dev.py$(RESET)"
@cd python && python3 dev.py lint
python-test: check-valkey-server
@echo "$(GREEN)Running Python tests$(RESET)"
@cd python && python3 dev.py test
##
## NodeJS targets
##
node: .build/node_deps
@echo "$(GREEN)Building for NodeJS (release)...$(RESET)"
@cd node && npm run build:release
.build/node_deps:
@echo "$(GREEN)Installing NodeJS dependencies...$(RESET)"
@cd node && npm i
@cd node/rust-client && npm i
@mkdir -p .build/ && touch .build/node_deps
node-test: .build/node_deps check-valkey-server
@echo "$(GREEN)Running tests for NodeJS$(RESET)"
@cd node && npm run build
cd node && npm test
node-lint: .build/node_deps
@echo "$(GREEN)Running linters for NodeJS$(RESET)"
@cd node && npx run lint:fix
##
## Prettier targets
##
prettier-check:
@echo "$(GREEN)Checking formatting with Prettier$(RESET)"
@npx prettier --check .github/
@for folder in node benchmarks/node benchmarks/utilities; do \
npx prettier --check $$folder; \
done
prettier-fix:
@echo "$(GREEN)Fixing formatting with Prettier$(RESET)"
@npx prettier --write .github/
@for folder in node benchmarks/node benchmarks/utilities; do \
npx prettier --write $$folder; \
done
##
## Go targets
##
go: .build/go_deps
$(MAKE) -C go build
go-test: .build/go_deps
$(MAKE) -C go test
go-lint: .build/go_deps
$(MAKE) -C go lint
.build/go_deps:
@echo "$(GREEN)Installing GO dependencies...$(RESET)"
$(MAKE) -C go install-build-tools install-dev-tools
@mkdir -p .build/ && touch .build/go_deps
##
## Common targets
##
check-valkey-server:
which valkey-server || which redis-server
clean:
rm -fr .build/
help:
@echo "$(GREEN)Listing Makefile targets:$(RESET)"
@echo $(shell grep '^[^#[:space:]].*:' Makefile|cut -d":" -f1|grep -v PHONY|grep -v "^.build"|sort)