-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
160 lines (133 loc) · 4.38 KB
/
Makefile
File metadata and controls
160 lines (133 loc) · 4.38 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# ClipFlow Pro - Makefile
# Advanced Clipboard Manager for GNOME Shell
# Created by Nick Otmazgin
EXTENSION_UUID = clipflow-pro@nickotmazgin.github.io
EXTENSION_NAME = ClipFlow Pro
# Directories
BUILD_DIR = build
DIST_DIR = dist
SCHEMAS_DIR = schemas
LOCALE_DIR = locale
# Extension installation path
INSTALL_PATH = ~/.local/share/gnome-shell/extensions/$(EXTENSION_UUID)
# Files to include in distribution
EXTENSION_FILES = \
extension.js \
prefs.js \
metadata.json \
stylesheet.css \
schemas/org.gnome.shell.extensions.clipflow-pro.gschema.xml \
icons/clipflow-pro-symbolic.svg
EXTRA_FILES = \
README.md \
LICENSE \
CHANGELOG.md \
CONTRIBUTING.md
# Default target
all: build
# Clean build artifacts
clean:
rm -rf $(BUILD_DIR)
rm -rf $(DIST_DIR)
rm -f *.zip
# Build the extension
build:
./build.sh
# Install the extension locally
install: build
./install.sh
# Uninstall the extension
uninstall:
@echo "Uninstalling $(EXTENSION_NAME)..."
rm -rf $(INSTALL_PATH)
@echo "Extension uninstalled"
# Create distribution package
dist: build
@echo "Creating distribution packages (flat zip + source)..."
mkdir -p $(DIST_DIR)
# Flat zip (top-level files) - exclude compiled schemas
rm -f $(DIST_DIR)/$(EXTENSION_UUID).shell-extension.zip
cd $(BUILD_DIR) && zip -r ../$(DIST_DIR)/$(EXTENSION_UUID).shell-extension.zip . -x "schemas/gschemas.compiled"
# Source zip
rm -f $(DIST_DIR)/clipflow-pro-source.zip
zip -r $(DIST_DIR)/clipflow-pro-source.zip \
$(EXTENSION_FILES) $(EXTRA_FILES) Makefile \
$(SCHEMAS_DIR) $(LOCALE_DIR) 2>/dev/null || true
@echo "Distribution packages created in $(DIST_DIR)/"
# Pack using GNOME Extensions tool
pack: build
@echo "Packing flat zip..."
mkdir -p $(DIST_DIR)
rm -f $(DIST_DIR)/$(EXTENSION_UUID).shell-extension.zip
cd $(BUILD_DIR) && zip -r ../$(DIST_DIR)/$(EXTENSION_UUID).shell-extension.zip .
@echo "Packed: $(DIST_DIR)/$(EXTENSION_UUID).shell-extension.zip"
# (Validation target removed) Use your editor tooling or CI linters.
# Development mode - install and watch for changes
dev: install
@echo "Development mode - watching for changes..."
@echo "Press Ctrl+C to stop"
while true; do \
inotifywait -e modify,create,delete -r . --exclude '\.git|$(BUILD_DIR)|$(DIST_DIR)' 2>/dev/null && \
make install && \
echo "Extension reloaded - restart GNOME Shell to see changes"; \
done
# Validate extension files
validate:
@echo "Validating extension files..."
# Check for required files
@for file in extension.js metadata.json; do \
if [ ! -f "$$file" ]; then \
echo "ERROR: Required file $$file is missing"; \
exit 1; \
fi; \
done
# Validate metadata.json
@if ! python3 -m json.tool metadata.json > /dev/null 2>&1; then \
echo "ERROR: metadata.json is not valid JSON"; \
exit 1; \
fi
# Check for GSettings schema
@if [ -f "$(SCHEMAS_DIR)/org.gnome.shell.extensions.clipflow-pro.gschema.xml" ]; then \
if ! xmllint --noout $(SCHEMAS_DIR)/org.gnome.shell.extensions.clipflow-pro.gschema.xml; then \
echo "ERROR: GSettings schema is not valid XML"; \
exit 1; \
fi; \
fi
@echo "Validation passed!"
# Test the extension
test: validate install
@echo "Testing extension..."
gnome-extensions enable $(EXTENSION_UUID)
@echo "Extension enabled - check GNOME Shell for any errors"
journalctl -f | grep -i clipflow &
sleep 5
kill %1 2>/dev/null || true
# Package for different distribution methods
package: dist
@echo "Creating distribution packages..."
# Create Flatpak manifest (if needed in future)
# Create .deb package structure (if needed)
# Create RPM spec (if needed)
@echo "Packaging complete!"
# Help target
help:
@echo "ClipFlow Pro Build System"
@echo ""
@echo "Available targets:"
@echo " all - Build the extension (default)"
@echo " build - Build the extension"
@echo " install - Install the extension locally"
@echo " uninstall- Uninstall the extension"
@echo " dist - Create distribution packages"
@echo " dev - Development mode with file watching"
@echo " validate - Validate extension files"
@echo " test - Test the extension"
@echo " package - Create packages for distribution"
@echo " clean - Clean build artifacts"
@echo " help - Show this help message"
# Version management
version:
@python3 tools/version.py show
bump-version:
@python3 tools/version.py bump
.PHONY: all build install uninstall dist dev validate test package clean help version bump-version