-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
121 lines (96 loc) · 3.02 KB
/
Makefile
File metadata and controls
121 lines (96 loc) · 3.02 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
114
115
116
117
118
119
120
121
# ONDC Crypto SDK Development Makefile
# Provides convenient commands for development workflow
.PHONY: help build test check fmt clippy clean doc install-hooks run-staging run-production
# Default target
help:
@echo "ONDC Crypto SDK Development Commands:"
@echo ""
@echo "Build Commands:"
@echo " build - Build all crates in release mode"
@echo " build-dev - Build all crates in debug mode"
@echo " check - Check that code compiles without warnings"
@echo ""
@echo "Testing Commands:"
@echo " test - Run all tests"
@echo " test-release - Run tests in release mode"
@echo " test-coverage - Run tests with coverage reporting"
@echo ""
@echo "Code Quality Commands:"
@echo " fmt - Format code with rustfmt"
@echo " fmt-check - Check code formatting"
@echo " clippy - Run clippy linter"
@echo " audit - Run security audit"
@echo ""
@echo "Documentation Commands:"
@echo " doc - Generate documentation"
@echo " doc-open - Generate and open documentation"
@echo ""
@echo "Setup Commands:"
@echo " install-hooks - Install pre-commit hooks"
@echo " clean - Clean build artifacts"
@echo ""
@echo "Run Commands:"
@echo " run-staging - Run BAP server with staging config"
@echo " run-production - Run BAP server with production config"
@echo ""
# Build commands
build:
cargo build --release --all-targets --all-features
build-dev:
cargo build --all-targets --all-features
check:
cargo check --all-targets --all-features
# Testing commands
test:
cargo test --all-targets --all-features
test-release:
cargo test --release --all-targets --all-features
test-coverage:
cargo install cargo-tarpaulin --no-default-features --features native-tls
cargo tarpaulin --all-features --out Html --output-dir coverage
# Code quality commands
fmt:
cargo fmt --all
fmt-check:
cargo fmt --all -- --check
clippy:
cargo clippy --all-targets --all-features -- -D warnings
audit:
cargo audit
# Documentation commands
doc:
cargo doc --all-features --no-deps
doc-open:
cargo doc --all-features --no-deps --open
# Setup commands
install-hooks:
pre-commit install
pre-commit install --hook-type commit-msg
clean:
cargo clean
rm -rf coverage/
rm -rf target/
# Development workflow commands
dev-setup: install-hooks
@echo "Development environment setup complete!"
@echo "Run 'make check' to verify everything is working."
pre-commit: fmt clippy test
@echo "Pre-commit checks passed!"
ci: fmt-check clippy test audit
@echo "CI checks passed!"
# Security and performance commands
bench:
cargo bench --all-features
security-check: audit clippy
@echo "Security checks completed!"
# Release preparation
release-prep: clean build test-release doc audit
@echo "Release preparation completed!"
# Quick development cycle
dev: fmt clippy test
@echo "Development cycle completed!"
# Run commands with environment configuration
run-staging:
cd ondc-bap && ONDC_ENV=staging cargo run
run-production:
cd ondc-bap && ONDC_ENV=production cargo run