-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (47 loc) · 2.03 KB
/
Makefile
File metadata and controls
57 lines (47 loc) · 2.03 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
APP_NAME = Glance
INSTALL_PATH = /Applications
all: build install register reset ## Fully build and install
help: ## Show this help
@grep -E '^([a-zA-Z_-]+):.*## ' $(MAKEFILE_LIST) | awk -F ':.*## ' '{printf "%-20s %s\n", $$1, $$2}'kk
build: ## Build the Application in the `build` folder
@echo "Building Quick Look extension..."
@rm -rf build
xcodebuild -scheme $(APP_NAME) -configuration Release -derivedDataPath build clean build
@echo "Build complete"
install: ## Install the Application into `INSTALL_PATH` (`/Applications` by default)
@echo "Installing to $(INSTALL_PATH)..."
@rm -rf $(INSTALL_PATH)/$(APP_NAME).app
@cp -R build/Build/Products/Release/$(APP_NAME).app $(INSTALL_PATH)/
@echo "Installed to $(INSTALL_PATH)/$(APP_NAME).app"
register: ## Register the QuickLook plugin with `pluginkit`
@echo "Registering extension with system..."
@pluginkit -a $(INSTALL_PATH)/$(APP_NAME).app/Contents/PlugIns/QLPlugin.appex || true
@echo "Registration complete"
reset: ## Reset Quick Look system
@echo "Resetting Quick Look..."
@qlmanage -r
@qlmanage -r cache
@killall Finder 2>/dev/null || true
@killall quicklookd 2>/dev/null || true
@echo "Quick Look reset"
check: ## Check whether Quick Look plugin is properly installed
@echo "Checking extension status..."
@echo ""
@echo "Extension registration:"
@pluginkit -m -v | grep -A3 -i $(APP_NAME) || echo "Not registered"
@echo ""
@echo "Installed location:"
@ls -la $(INSTALL_PATH)/$(APP_NAME).app/Contents/PlugIns/*.appex 2>/dev/null || echo "Not found"
@echo ""
clean: # Clean build artifcats
@echo "Cleaning build artifacts..."
@rm -rf build
@rm -rf ~/Library/Developer/Xcode/DerivedData/$(APP_NAME)-*
@echo "Clean complete"
uninstall: clean # Uninstall the application from `INSTALL_PATH` (`/Applications`)
@echo "Uninstalling..."
@rm -rf $(INSTALL_PATH)/$(APP_NAME).app
@pluginkit -r $(INSTALL_PATH)/$(APP_NAME).app/Contents/PlugIns/QLPlugin.appex 2>/dev/null || true
@$(MAKE) reset
@echo "Uninstalled"
.PHONY: help all build install register reset check clean uninstall