-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
86 lines (70 loc) · 2.45 KB
/
Makefile
File metadata and controls
86 lines (70 loc) · 2.45 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
.PHONY: all build test clean install fmt clippy run package
CARGO ?= $(shell command -v cargo 2>/dev/null || echo "$(HOME)/.cargo/bin/cargo")
# Default target
all: build
# Build the project
build:
@echo "Building skillctrl-desktop frontend and native binaries..."
@test -x "$(CARGO)" || (echo "cargo not found. Install Rust: https://rustup.rs and run 'source $$HOME/.cargo/env'" && exit 1)
@if [ ! -d "skillctrl-desktop/node_modules" ]; then cd skillctrl-desktop && npm ci --no-fund --no-audit; fi
cd skillctrl-desktop && npm run build
$(CARGO) build --locked --release
# Build in debug mode
debug:
@echo "Building skillctrl-desktop frontend and debug binaries..."
@test -x "$(CARGO)" || (echo "cargo not found. Install Rust: https://rustup.rs and run 'source $$HOME/.cargo/env'" && exit 1)
@if [ ! -d "skillctrl-desktop/node_modules" ]; then cd skillctrl-desktop && npm ci --no-fund --no-audit; fi
cd skillctrl-desktop && npm run build
$(CARGO) build --locked
# Run tests
test:
@echo "Running tests..."
@if [ ! -d "skillctrl-desktop/node_modules" ]; then cd skillctrl-desktop && npm ci --no-fund --no-audit; fi
cd skillctrl-desktop && npm run build
$(CARGO) test --workspace --locked
# Run tests with output
test-verbose:
@echo "Running tests (verbose)..."
@if [ ! -d "skillctrl-desktop/node_modules" ]; then cd skillctrl-desktop && npm ci --no-fund --no-audit; fi
cd skillctrl-desktop && npm run build
$(CARGO) test --workspace --locked -- --nocapture
# Format code
fmt:
@echo "Formatting code..."
$(CARGO) fmt
# Run linter
clippy:
@echo "Running clippy..."
$(CARGO) clippy --locked -- -D warnings
# Clean build artifacts
clean:
@echo "Cleaning..."
$(CARGO) clean
# Install locally
install: build
@echo "Installing skillctrl..."
$(CARGO) install --locked --path crates/skillctrl-cli
# Package a distributable binary archive
package:
@echo "Packaging skillctrl and skillctrl-desktop..."
bash ./package.sh
# Run the CLI
run:
$(CARGO) run --locked -- --help
# Update dependencies
update:
@echo "Updating dependencies..."
$(CARGO) update
# Check for issues (without building)
check:
@echo "Checking..."
@if [ ! -d "skillctrl-desktop/node_modules" ]; then cd skillctrl-desktop && npm ci --no-fund --no-audit; fi
cd skillctrl-desktop && npm run build
$(CARGO) check --workspace --locked
# Run all checks
check-all: fmt clippy test
@echo "All checks passed!"
# Run example commands
demo:
@echo "Running demo..."
./target/release/skillctrl source list || true