-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (72 loc) · 2.24 KB
/
Makefile
File metadata and controls
97 lines (72 loc) · 2.24 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
# XDK SDK Generator
.PHONY: all check build test clean help
.PHONY: generate python typescript
.PHONY: test-python test-typescript test-sdks
.PHONY: fmt clippy test-generator
.PHONY: versions
# =====================================
# Default
# =====================================
all: check test-generator
# =====================================
# SDK Generation (local dev)
# =====================================
generate: python typescript
python:
cargo run -- python --latest true
typescript:
cargo run -- typescript --latest true
# =====================================
# SDK Testing (local dev)
# =====================================
test-sdks: test-python test-typescript
test-python: python
cd xdk/python && uv sync && uv run pytest tests/ -v
test-typescript: typescript
cd xdk/typescript && npm ci && npm run build && npm run type-check && npm test
# =====================================
# Generator
# =====================================
fmt:
cargo fmt --all -- --check
clippy:
cargo clippy --all --all-targets --all-features -- -D warnings
check: fmt clippy
build:
cargo build
test-generator:
cargo test --verbose
test: test-generator test-sdks
# =====================================
# Version Management
# =====================================
versions:
@grep -E "^(python|typescript) = " xdk-config.toml
# =====================================
# Cleanup
# =====================================
clean:
rm -rf xdk/python xdk/typescript
cargo-clean:
cargo clean
# =====================================
# Help
# =====================================
help:
@echo "XDK SDK Generator"
@echo ""
@echo "Local Development:"
@echo " make python Generate Python SDK"
@echo " make typescript Generate TypeScript SDK"
@echo " make test-python Generate + test Python SDK"
@echo " make test-typescript Generate + test TypeScript SDK"
@echo ""
@echo "Generator:"
@echo " make check Run fmt + clippy"
@echo " make test-generator Run Rust tests"
@echo " make build Build generator"
@echo ""
@echo "Release:"
@echo " ./scripts/version.sh <python|typescript|all> <patch|minor|major>"
@echo " git add xdk-config.toml && git commit && git push"
@echo " Then: Actions -> Release SDK -> Run workflow"