-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
57 lines (44 loc) · 1.27 KB
/
Makefile
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
formatting_header := \033[1m
formatting_command := \033[1;34m
formatting_desc := \033[0;32m
formatting_none := \033[0m
.PHONY: help test clean build lint
.DEFAULT_GOAL := help
## Show help for each of the Makefile recipes.
help:
@printf "${formatting_header}Available targets:\n"
@awk -F '## ' '/^## /{desc=$$2}/^[a-zA-Z0-9][a-zA-Z0-9_-]+:/{gsub(/:.*/, "", $$1); printf " ${formatting_command}%-20s ${formatting_desc}%s${formatting_none}\n", $$1, desc}' $(MAKEFILE_LIST) | sort
@printf "\n"
## Verify code is ready for commit to branch, runs tests and verifies formatting.
verify: build test lint
@echo "Code is ready to commit."
## Prints dotnet info
info:
@echo "Print info and version"
dotnet --info
dotnet --version
## Lint the dotnet code
lint:
@echo "Verifying code formatting..."
dotnet format --verify-no-changes
## Does a dotnet clean
clean:
dotnet clean
## Restores all dotnet projects
restore:
dotnet restore
## Builds all the code
build: restore
dotnet build --no-restore
## Formats files using dotnet format
format:
dotnet format
## Run all tests
test: build
dotnet test --no-build
## Tests run with the sonarcloud analyser
sonarcloud-test:
dotnet test --no-build
## Run all Unit-tests
unit-test:
dotnet test --filter 'FullyQualifiedName!~IntegrationTests'