-
Notifications
You must be signed in to change notification settings - Fork 869
/
Makefile
34 lines (26 loc) · 921 Bytes
/
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
# This is a maintainer-centric Makefile to help performing
# typical operations for all projects in this repo.
#
# Example:
# make build
OS=$(shell uname -s)
EXAMPLE_DIRS=$(shell find ./examples -name '*.csproj' -exec dirname {} \;)
TEST_DIRS=$(shell find ./test -name '*.csproj' \;)
UNIT_TEST_DIRS=$(shell find . -type d -regex '.*UnitTests$$' -exec basename {} \;)
# We want to run tests by default with latest version of .NET
DEFAULT_TEST_FRAMEWORK?=net8.0
all:
@echo "Usage: make <dotnet-command>"
@echo "Example: make build - runs 'dotnet build' for all projects"
.PHONY: test
build:
for d in $(EXAMPLE_DIRS) ; do dotnet $@ $$d; done ; \
for d in $(TEST_DIRS) ; do dotnet $@ $$d; done ;
test:
@(for d in $(UNIT_TEST_DIRS) ; do \
dotnet test test/$$d/$$d.csproj ; \
done)
test-latest:
@(for d in $(UNIT_TEST_DIRS) ; do \
dotnet test -f $(DEFAULT_TEST_FRAMEWORK) test/$$d/$$d.csproj ; \
done)