-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
109 lines (89 loc) · 2.96 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Makefile for PatalInputMethod
# Variables
SCRIPT_DIR = ./script
SRC_DIR = ./macOS
DIST_DIR = ./dist
PKG = PatalInputMethod.pkg
APP_ROOT = /Library/Input\ Methods/Patal.app
APP_USER = /Users/$(USER)/Library/Input\ Methods/Patal.app
SCHEME = Patal
# Default target
.DEFAULT_GOAL := help
.PHONY: all format install package distribute clean build kill remove remove-root remove-user list help test test-only test-verbose
all: format install package distribute
test:
@echo "Running tests..."
@cd $(SRC_DIR) && xcodebuild test \
-scheme $(SCHEME) \
-destination 'platform=macOS' \
| xcbeautify
test-only:
@echo "Running single test..."
@cd $(SRC_DIR) && xcodebuild test \
-scheme $(SCHEME) \
-destination 'platform=macOS' \
-only-testing:PatalTests/$(CLASS) \
| xcbeautify
test-verbose:
@echo "Running tests with verbose output..."
@cd $(SRC_DIR) && xcodebuild test \
-scheme $(SCHEME) \
-destination 'platform=macOS' \
-verbose
format:
@echo "Running format script..."
@cd $(SCRIPT_DIR) && sh format.sh
build-verbose:
@echo "Building the project..."
@cd $(SRC_DIR) && xcodebuild -verbose -scheme Patal -configuration Release build
build:
@echo "Building the project..."
@cd $(SRC_DIR) && xcodebuild -verbose -scheme Patal -configuration Release build | xcpretty
install:
@echo "Running install script..."
@cd $(SCRIPT_DIR) && sh install.sh
package:
@echo "Running packaging script..."
@cd $(SCRIPT_DIR) && sh packaging.sh
distribute:
@echo "Running distribute script..."
@cd $(SCRIPT_DIR) && sh distribute.sh
clean:
@echo "Cleaning up..."
@rm -rf $(DIST_DIR)/*.zip
@rm -rf $(DIST_DIR)/*.pkg
@rm -rf $(DIST_DIR)/Distribution.xml
@echo "Cleaned up."
kill:
@echo "Killing Patal process..."
@killall Patal || true
remove: remove-user remove-root
remove-root:
@echo "Removing root Patal app with root permissions..."
@sudo rm -rf $(APP_ROOT)
@echo "Removed root Patal app."
remove-user:
@echo "Removing user Patal app..."
@rm -rf $(APP_USER)
@echo "Removed user Patal app."
list:
@echo "Listing dist directory..."
@ls -l $(DIST_DIR)
help:
@echo "Available targets:"
@echo " all - Run format, install, package, and distribute"
@echo " format - Run the format script"
@echo " build - Build the project using xcodebuild"
@echo " install - Run the install script"
@echo " package - Run the packaging script"
@echo " distribute - Run the distribute script"
@echo " clean - Clean up the dist directory"
@echo " kill - Kill the Patal process"
@echo " remove - Remove both root and user Patal apps"
@echo " remove-root - Remove the root Patal app"
@echo " remove-user - Remove the user Patal app"
@echo " list - List the contents of the dist directory"
@echo " test - Run tests with pretty formatting"
@echo " test-only - Run a single test (Usage: make test-only CLASS=AClass)"
@echo " test-verbose- Run tests with verbose output"
@echo " help - Show this help message"