-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
92 lines (78 loc) · 3.52 KB
/
Copy pathMakefile
File metadata and controls
92 lines (78 loc) · 3.52 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Makefile for SkillUI Wails Application
# App Store / TestFlight signing config
BUNDLE_ID = com.skillui
APP_NAME = SkillUI
APP_PATH = build/bin/$(APP_NAME).app
PROVISION_PROFILE ?= $(HOME)/Library/MobileDevice/Provisioning\ Profiles/$(APP_NAME)_AppStore.provisionprofile
# Application signing identity: "3rd Party Mac Developer Application: Your Name (TEAMID)"
SIGN_IDENTITY ?= "3rd Party Mac Developer Application"
# Installer signing identity: "3rd Party Mac Developer Installer: Your Name (TEAMID)"
INSTALLER_IDENTITY ?= "3rd Party Mac Developer Installer"
# Local signing identity for install (auto-detect Developer ID cert hash from Keychain, no Apple notarization)
LOCAL_SIGN_IDENTITY ?= $(shell security find-identity -v -p codesigning 2>/dev/null | awk '/Developer ID Application:/{print $$2; exit}')
#
#
.PHONY: help dev build clean install check-deps build-and-install
# Default target
help:
@echo "Available targets:"
@echo " dev - Start the development server"
@echo " build - Build the application"
@echo " build-and-install - Build, sign locally (Developer ID cert if available, else ad-hoc), install to /Applications and launch"
@echo " clean - Clean build artifacts"
@echo " install - Install dependencies"
@echo " check-deps - Check if required tools are installed"
# Check if required tools are installed
check-deps:
@command -v go >/dev/null 2>&1 || { echo "Go is not installed. Please install Go."; exit 1; }
@command -v wails >/dev/null 2>&1 || { echo "Wails is not installed. Please install Wails: go install github.com/wailsapp/wails/v2/cmd/wails@latest"; exit 1; }
@command -v npm >/dev/null 2>&1 || { echo "npm is not installed. Please install Node.js and npm."; exit 1; }
# Install dependencies
install: check-deps
cd frontend && npm install
go mod tidy
# Start development server
dev: check-deps
wails dev
# Build the application
build: check-deps
wails build
#
# Build the application with DevTools enabled (F12 opens inspector)
# Note: macOS builds use private WebKit APIs - not suitable for App Store submission
build-devtools: check-deps
wails build -tags devtools
# Clean build artifacts
clean:
rm -rf build/bin
rm -rf frontend/dist
rm -rf frontend/node_modules
go clean
# Build the app, sign it locally (Developer ID cert if available, otherwise ad-hoc),
# then install it into /Applications and launch. No Apple notarization is performed.
build-and-install: check-deps
$(MAKE) install
$(MAKE) build
@if [ -z "$(LOCAL_SIGN_IDENTITY)" ]; then \
echo ">>> No Developer ID certificate found, falling back to ad-hoc signing"; \
codesign --force --deep --sign - $(APP_PATH); \
else \
echo ">>> Signing $(APP_PATH) with '$(LOCAL_SIGN_IDENTITY)' (local only, no notarization)"; \
codesign --force --deep --sign "$(LOCAL_SIGN_IDENTITY)" $(APP_PATH); \
fi
codesign --verify --deep --strict --verbose=2 $(APP_PATH)
@echo ">>> Stopping running SkillUI instances"
pkill -f '/SkillUI.app' 2>/dev/null || true
@echo ">>> Installing to /Applications/SkillUI.app"
@rm -rf /Applications/SkillUI.app; \
if cp -R $(APP_PATH) /Applications/SkillUI.app; then \
echo ">>> Installed to /Applications/SkillUI.app (no sudo needed)"; \
else \
echo ">>> /Applications not writable by current user, retrying with sudo..."; \
sudo rm -rf /Applications/SkillUI.app; \
sudo cp -R $(APP_PATH) /Applications/SkillUI.app; \
fi
codesign --verify --deep --strict --verbose=2 /Applications/SkillUI.app
@echo ">>> Done. Launching SkillUI..."
open /Applications/SkillUI.app
#