-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
48 lines (38 loc) · 1.02 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
BASEDIR = $(CURDIR)
SOLUTION = $(BASEDIR)/NServiceBus.MongoDB.sln
PROJECT = $(BASEDIR)/src/NServiceBus.MongoDB
TESTS = $(BASEDIR)/src/NServiceBus.MongoDB.Tests
CONFIGURATION ?= Debug
BUILD_OPTS = --no-restore -c $(CONFIGURATION)
TEST_OPTS = --no-restore -c $(CONFIGURATION)
RESTORE_OPTS =
PACK_OPTS = --no-restore -c $(CONFIGURATION) /p:Version=$(GitVersion_SemVer)
CLEAN_DIRS = \
src/*/bin \
src/*/obj
default: restore build test
all: restore build test pack
build: restore
$(printTarget)
@dotnet build $(BUILD_OPTS) $(SOLUTION)
test: build
$(printTarget)
@dotnet test $(TEST_OPTS) $(TESTS)
pack: build
$(printTarget)
@dotnet pack $(PACK_OPTS) $(PROJECT)
restore:
$(printTarget)
@dotnet restore $(RESTORE_OPTS) $(SOLUTION)
clean:
$(printTarget)
@dotnet clean
rm -rf $(CLEAN_DIRS)
# Helper function to pretty print targets as they execute
TARGET_COLOR := \033[0;32m
RED := \033[0;31m
NO_COLOR := \033[m
CURRENT_TARGET = $(@)
define printTarget
@printf "%b" "\n$(TARGET_COLOR)$(CURRENT_TARGET):$(NO_COLOR)\n";
endef