Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
143 lines (117 loc) · 4.34 KB
/
Copy pathMakefile
File metadata and controls
143 lines (117 loc) · 4.34 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# ArenaX Development Makefile
.PHONY: help install build test clean lint format check-all docker-build docker-up docker-down
# Default target
help:
@echo "ArenaX Development Commands:"
@echo ""
@echo "Installation:"
@echo " install Install all dependencies"
@echo " install-frontend Install frontend dependencies"
@echo " install-backend Install backend dependencies"
@echo " install-contracts Install contracts dependencies"
@echo ""
@echo "Development:"
@echo " dev Start all services in development mode"
@echo " dev-frontend Start frontend development server"
@echo " dev-backend Start backend development server"
@echo ""
@echo "Building:"
@echo " build Build all projects"
@echo " build-frontend Build frontend for production"
@echo " build-backend Build backend"
@echo " build-contracts Build contracts for deployment"
@echo ""
@echo "Testing:"
@echo " test Run all tests"
@echo " test-frontend Run frontend tests"
@echo " test-backend Run backend tests"
@echo " test-contracts Run contracts tests"
@echo ""
@echo "Code Quality:"
@echo " lint Lint all code"
@echo " format Format all code"
@echo " check-all Run all checks (lint, format, test)"
@echo ""
@echo "Docker:"
@echo " docker-build Build Docker images"
@echo " docker-up Start services with Docker Compose"
@echo " docker-down Stop Docker services"
@echo ""
@echo "Utilities:"
@echo " clean Clean all build artifacts"
@echo " setup Initial project setup"
# Installation
install: install-frontend install-backend install-contracts
install-frontend:
@echo "Installing frontend dependencies..."
@if command -v yarn >/dev/null 2>&1; then cd frontend && yarn install; else echo "Yarn not found, skipping frontend installation"; fi
install-backend:
@echo "Installing backend dependencies..."
@if [ -f "backend/Cargo.toml" ]; then cd backend && cargo build; else echo "Backend Cargo.toml not found, skipping backend installation"; fi
install-contracts:
@echo "Installing contracts dependencies..."
cd contracts && cargo build
# Development
dev:
@echo "Starting all services..."
@echo "Run 'make dev-frontend' and 'make dev-backend' in separate terminals"
dev-frontend:
@echo "Starting frontend development server..."
@if command -v yarn >/dev/null 2>&1; then cd frontend && yarn dev; else echo "Yarn not found, cannot start frontend"; fi
dev-backend:
@echo "Starting backend development server..."
cd backend && cargo run
# Building
build: build-frontend build-backend build-contracts
build-frontend:
@echo "Building frontend..."
cd frontend && yarn build
build-backend:
@echo "Building backend..."
cd backend && cargo build --release
build-contracts:
@echo "Installing WASM target..."
rustup target add wasm32-unknown-unknown
@echo "Building contracts..."
cd contracts && cargo build --target wasm32-unknown-unknown --release
# Testing
test: test-issue-1158
test-issue-1158:
@echo "Running Issue #1158 verification tests..."
@python3 -m unittest discover -s tests -p "test_issue_*.py"
test-frontend:
@echo "Running frontend tests..."
@if [ -f "frontend/node_modules/.bin/jest" ]; then cd frontend && yarn test; else echo "Frontend dependencies not installed, skipping frontend tests"; fi
test-backend:
@echo "Running backend tests..."
@if [ -f "backend/Cargo.toml" ]; then cd backend && cargo test; else echo "Backend Cargo.toml not found, skipping backend tests"; fi
test-contracts:
@echo "Running contracts tests..."
@if [ -f "contracts/Cargo.toml" ]; then cd contracts && cargo test; else echo "Contracts Cargo.toml not found, skipping contracts tests"; fi
# Code Quality
lint:
@echo "Linting frontend..."
cd frontend && yarn lint
@echo "Linting backend..."
cd backend && cargo clippy
@echo "Linting contracts..."
cd contracts && cargo clippy
format:
@echo "Formatting frontend..."
cd frontend && yarn format
@echo "Formatting backend..."
cd backend && cargo fmt
@echo "Formatting contracts..."
cd contracts && cargo fmt
check-all: lint format test
@echo "All checks completed!"
# Docker
docker-build:
@echo "Building Docker images..."
@docker-compose build
docker-up:
@echo "Starting services with Docker Compose..."
@docker-compose up -d
docker-down:
@echo "Stopping Docker services..."
@docker-compose down