-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (47 loc) · 1.75 KB
/
Makefile
File metadata and controls
56 lines (47 loc) · 1.75 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
.PHONY: help test test-net48 test-net8 test-net9 build restore lint fmt check
# Default target when running just 'make'
help:
@echo "Available targets:"
@echo " test - Run all tests"
@echo " test-net48 - Run tests for .NET Framework 4.8"
@echo " test-net8 - Run tests for .NET 8.0"
@echo " test-net9 - Run tests for .NET 9.0"
@echo " lint - Verify code formatting and style"
@echo " fmt - Apply code formatting"
@echo " check - Run all checks (lint + test)"
# Run tests for all supported frameworks
test: test-net48 test-net8 test-net9
@echo "✅ All tests completed successfully!"
# Restore NuGet packages
restore:
@echo "📦 Restoring NuGet packages..."
@dotnet restore ./OpenFga.Sdk.sln
# Build the solution
build: restore
@echo "🔨 Building solution..."
@dotnet build ./OpenFga.Sdk.sln --no-restore
# Run tests for .NET Framework 4.8
test-net48: build
@echo "🚀 Running tests for .NET Framework 4.8..."
@dotnet test --framework net48 --no-build
# Run tests for .NET 8.0
test-net8: build
@echo "🚀 Running tests for .NET 8.0..."
@dotnet test --framework net8.0 --no-build
# Run tests for .NET 9.0
test-net9: build
@echo "🚀 Running tests for .NET 9.0..."
@dotnet test --framework net9.0 --no-build
# Verify code formatting and analyzers
lint:
@echo "🔍 Checking code formatting..."
@dotnet format --verify-no-changes --severity info || (echo "❌ Code formatting issues found. Run 'make fmt' to fix." && exit 1)
@echo "✅ Code formatting looks good!"
# Apply formatting fixes
fmt:
@echo "🎨 Applying code formatting..."
@dotnet format ./OpenFga.Sdk.sln
@echo "✅ Code formatting applied successfully!"
# Convenience target to run all checks
check: lint test
@echo "✨ All checks completed successfully!"