-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (43 loc) · 1.88 KB
/
Copy pathMakefile
File metadata and controls
55 lines (43 loc) · 1.88 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
# =============================================================================
# Configuration Variables
# =============================================================================
# Build Configuration
CONFIGURATION ?= Release
VERBOSITY ?=
# Test Configuration
COVERAGE_REPORT_PATH ?= coverage_report
BLAME_HANG_TIMEOUT ?= 30000
# Report Configuration
REPORT_DIR = $(COVERAGE_REPORT_PATH)
SUMMARY_FILE = $(REPORT_DIR)/Summary.md
# =============================================================================
# Targets
# =============================================================================
.PHONY: check-tools build lint format test test-report docs
# Ensure all tools are installed locally
check-tools:
@dotnet tool restore > /dev/null
# Build the project
build:
dotnet build --configuration $(CONFIGURATION)
# Check formatting and code style
lint: check-tools
dotnet format --verify-no-changes $(if $(VERBOSITY),--verbosity $(VERBOSITY))
dotnet format style --verify-no-changes $(if $(VERBOSITY),--verbosity $(VERBOSITY))
dotnet format analyzers --verify-no-changes $(if $(VERBOSITY),--verbosity $(VERBOSITY))
# Apply formatting to the entire project
format: check-tools
dotnet format
dotnet format style
dotnet format analyzers
# Test with code coverage
test: build
dotnet test --configuration $(CONFIGURATION) --verbosity normal --blame-hang --blame-hang-timeout $(BLAME_HANG_TIMEOUT) --collect:"Code Coverage;Format=cobertura" --logger "trx;LogFileName=test-results.trx"
# Test report
test-report: check-tools
dotnet reportgenerator -reports:"**/TestResults/**/*.cobertura.xml" -targetdir:"$(REPORT_DIR)" -reporttypes:"HtmlInline;Cobertura;Badges;MarkdownSummary"
@echo "✅ Test report generated in '$(REPORT_DIR)' directory"
@[ -f $(SUMMARY_FILE) ] && cat $(SUMMARY_FILE) || echo " 🚨 Summary not found"
# Generate documentation
docs: check-tools build
dotnet docfx ./docfx.json