-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (61 loc) · 1.92 KB
/
Copy pathMakefile
File metadata and controls
75 lines (61 loc) · 1.92 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
SOLUTION := Window-Switcher.slnx
APP_PROJECT := src/WindowSwitcher/WindowSwitcher.csproj
TEST_PROJECT := src/WindowSwitcher.Tests/WindowSwitcher.Tests.csproj
BUILD_SCRIPT := ./build/build.sh
BUILD_CMD := ./build/build.cmd
ifeq ($(OS),Windows_NT)
NUKE := $(BUILD_CMD)
else
NUKE := $(BUILD_SCRIPT)
endif
.PHONY: help restore build run test test-no-build clean format format-check artifacts installer appimage
help:
@echo "Window Switcher development commands"
@echo ""
@echo " make restore Restore NuGet packages and local .NET tools"
@echo " make build Build the solution"
@echo " make run Run the desktop app"
@echo " make test Run the test project"
@echo " make test-no-build Run tests without rebuilding"
@echo " make clean Clean the solution"
@echo " make format Format source with CSharpier"
@echo " make format-check Check source formatting with CSharpier"
@echo " make artifacts Build host-specific release artifacts with Nuke"
@echo " make installer Build the Windows installer with Nuke (Windows only)"
@echo " make appimage Build the Linux AppImage with Nuke (Linux only)"
restore:
dotnet restore $(SOLUTION)
dotnet tool restore
build:
dotnet build $(SOLUTION)
run:
dotnet run --project $(APP_PROJECT)
test:
dotnet test $(TEST_PROJECT)
test-no-build:
dotnet test $(TEST_PROJECT) --no-build
clean:
dotnet clean $(SOLUTION)
format:
dotnet tool restore
dotnet csharpier .
format-check:
dotnet tool restore
dotnet csharpier . --check
artifacts:
$(NUKE) --target Artifacts
installer:
ifeq ($(OS),Windows_NT)
$(BUILD_CMD) --target Installer
else
@echo "The Windows installer can only be built on Windows."
@echo "On Linux, use 'make appimage' or 'make artifacts' to build the AppImage."
@exit 2
endif
appimage:
ifeq ($(OS),Windows_NT)
@echo "The Linux AppImage can only be built on Linux."
@exit 2
else
$(BUILD_SCRIPT) --target AppImage
endif