forked from confluentinc/confluent-kafka-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (29 loc) · 1.17 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
# 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' -exec dirname {} \;)
LINUX_FRAMEWORK=netcoreapp2.0
DEFAULT_FRAMEWORK?=$(LINUX_FRAMEWORK)
all:
@echo "Usage: make <dotnet-command>"
@echo "Example: make build - runs 'dotnet build' for all projects"
.PHONY: test
build:
# Assuming .NET Core on Linux (net451 will not work).
@(if [ "$(OS)" = "Linux" ]] ; then \
for d in $(EXAMPLE_DIRS) ; do dotnet $@ -f $(LINUX_FRAMEWORK) $$d; done ; \
for d in $(TEST_DIRS) ; do dotnet $@ -f $(LINUX_FRAMEWORK) $$d; done ; \
else \
for d in $(EXAMPLE_DIRS) ; do dotnet $@ -f $(DEFAULT_FRAMEWORK) $$d; done ; \
for d in $(TEST_DIRS) ; do dotnet $@ -f $(DEFAULT_FRAMEWORK) $$d; done ; \
fi)
test:
@(if [ "$(OS)" = "Linux" ]] ; then \
dotnet test -f $(LINUX_FRAMEWORK) test/Confluent.Kafka.UnitTests/Confluent.Kafka.UnitTests.csproj ; \
else \
dotnet test -f $(DEFAULT_FRAMEWORK) test/Confluent.Kafka.UnitTests/Confluent.Kafka.UnitTests.csproj ; \
fi)