-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (66 loc) · 2.45 KB
/
Copy pathMakefile
File metadata and controls
83 lines (66 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
# Makefile for zerobus-sdk-dotnet
.PHONY: help build build-rust build-dotnet clean fmt fmt-dotnet fmt-rust lint lint-dotnet lint-rust check test test-dotnet test-rust examples release
help:
@echo "Available targets:"
@echo " make build - Build both Rust FFI and .NET SDK"
@echo " make build-rust - Build only the Rust FFI layer"
@echo " make build-dotnet - Build only the .NET SDK"
@echo " make clean - Remove build artifacts"
@echo " make fmt - Format all code (Rust and .NET)"
@echo " make fmt-dotnet - Format .NET code"
@echo " make fmt-rust - Format Rust code"
@echo " make lint - Run linters on all code"
@echo " make lint-dotnet - Run .NET linters"
@echo " make lint-rust - Run Rust linters"
@echo " make check - Run all checks (fmt and lint)"
@echo " make test - Run all tests (Rust and .NET)"
@echo " make test-rust - Run Rust unit tests"
@echo " make test-dotnet - Run .NET unit tests"
@echo " make examples - Build all examples"
build: build-rust build-dotnet
# Invoke via `bash` explicitly: on Windows, make resolves a bare `./build_native.sh`
# through a shell where `bash` is the WSL launcher (no distro installed) and fails.
build-rust:
bash ./build_native.sh
build-rust-force:
bash ./build_native.sh --force
build-dotnet: build-rust
@echo "Building .NET SDK..."
dotnet build
@echo "✓ .NET SDK built successfully"
clean:
@echo "Cleaning build artifacts..."
cd ../rust/ffi && cargo clean
rm -rf src/Zerobus/runtimes/*
rm -f libzerobus_ffi.a
rm -rf releases
@echo "✓ Clean complete"
fmt: fmt-dotnet fmt-rust
fmt-dotnet:
@echo "Formatting .NET code..."
dotnet format
fmt-rust:
@echo "Formatting Rust code..."
cd ../rust/ffi && cargo fmt --all
lint: lint-dotnet lint-rust
lint-dotnet:
@echo "Linting .NET code..."
@echo ".NET linting not available as standalone yet - skipping lint-dotnet"
lint-rust:
@echo "Linting Rust code..."
cd ../rust/ffi && cargo clippy --all -- -D warnings
check: fmt lint
test: test-rust test-dotnet
test-rust:
@echo "Running Rust tests..."
cd ../rust/ffi && cargo test -- --test-threads=1
test-dotnet:
@echo "Running .NET unit tests..."
dotnet test -p:SkipNativeBuild=true
@echo "✓ All .NET tests passed"
examples: build
@echo "Building examples..."
dotnet build examples/JsonSingle
dotnet build examples/JsonBatch
dotnet build examples/ProtoSingle
@echo "✓ Examples built successfully"