Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
223 lines (198 loc) · 6.87 KB
/
Copy pathMakefile
File metadata and controls
223 lines (198 loc) · 6.87 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
PREFIX ?= /usr/local
DESTDIR ?=
BINDIR = $(DESTDIR)$(PREFIX)/bin
DOCDIR = $(DESTDIR)$(PREFIX)/share/doc/git-issue
SHAREDIR = $(DESTDIR)$(PREFIX)/share/git-issue
MAN1DIR = $(DESTDIR)$(PREFIX)/share/man/man1
MAN8DIR = $(DESTDIR)$(PREFIX)/share/man/man8
.PHONY: install uninstall test test-deps test-content-safety test-dispatch test-layout test-flags test-registry bench-deps clean install-mcp uninstall-mcp test-mcp build-mcp clean-mcp
install:
@echo "Installing git-issue..."
install -d $(BINDIR)
install -d $(DOCDIR)
install -m 755 bin/git-issue $(BINDIR)/
ln -sf git-issue $(BINDIR)/git-issue-status
install -m 755 bin/git-note-commit $(BINDIR)/
install -m 755 bin/git-issue-compile-statuses $(BINDIR)/
install -d $(SHAREDIR)
install -m 644 share/git-issue/statuses.default $(SHAREDIR)/
install -m 644 share/git-issue/statuses.beads $(SHAREDIR)/
install -d $(SHAREDIR)/awk
install -m 644 share/git-issue/awk/*.awk $(SHAREDIR)/awk/
install -d $(SHAREDIR)/emacs
install -m 644 share/git-issue/emacs/*.el $(SHAREDIR)/emacs/
install -d $(SHAREDIR)/hooks
install -m 755 hooks/post-merge $(SHAREDIR)/hooks/
install -m 755 hooks/pre-push $(SHAREDIR)/hooks/
install -m 644 docs/* $(DOCDIR)/ 2>/dev/null || true
install -d $(MAN1DIR)
install -d $(MAN8DIR)
install -m 644 man/man1/*.1 $(MAN1DIR)/
install -m 644 man/man8/*.8 $(MAN8DIR)/
@echo "Installation complete!"
@echo ""
@echo "You can now use:"
@echo " git issue create 'Fix the navbar bug'"
@echo " git issue list"
@echo " git issue-status"
uninstall:
@echo "Uninstalling git-issue..."
rm -f $(BINDIR)/git-issue
rm -f $(BINDIR)/git-issue-status
rm -f $(BINDIR)/git-note-commit
rm -f $(BINDIR)/git-issue-compile-statuses
rm -rf $(DOCDIR)
rm -rf $(SHAREDIR)
rm -f $(MAN1DIR)/git-issue.1 $(MAN1DIR)/git-issue-status.1
rm -f $(MAN1DIR)/git-issue-compile-statuses.1 $(MAN1DIR)/git-note-commit.1
rm -f $(MAN1DIR)/gh-to-git-issue.1 $(MAN1DIR)/git-issue-to-gh.1
rm -f $(MAN8DIR)/git-issue.8
@echo "Uninstall complete!"
test:
@echo "Running git-issue tests..."
@if command -v git-issue >/dev/null 2>&1; then \
echo "✅ git-issue found in PATH"; \
echo "Running comprehensive test suite..."; \
chmod +x tests/*.sh; \
./tests/test_runner.sh; \
else \
echo "❌ git-issue not found in PATH"; \
exit 1; \
fi
test-unit:
@echo "Running unit tests..."
chmod +x tests/unit_tests.sh
./tests/unit_tests.sh
test-integration:
@echo "Running integration tests..."
chmod +x tests/integration_tests.sh
./tests/integration_tests.sh
test-deps:
@echo "Running dependency graph tests..."
chmod +x tests/test_deps.sh
./tests/test_deps.sh
test-content-safety:
@echo "Running content safety tests..."
chmod +x tests/test_content_safety.sh
./tests/test_content_safety.sh
test-dispatch:
@echo "Running dispatch tests..."
chmod +x tests/test_dispatch.sh
./tests/test_dispatch.sh
test-layout:
@echo "Running install layout smoke test..."
chmod +x tests/test_install_layout.sh
./tests/test_install_layout.sh
test-flags:
@echo "Running update flag tests..."
chmod +x tests/test_git_style_flags.sh
./tests/test_git_style_flags.sh
test-registry:
@echo "Running multi-project registry tests..."
chmod +x tests/test_registry.sh
./tests/test_registry.sh
test-porcelain: ## Run porcelain output tests
chmod +x tests/test_porcelain.sh
./tests/test_porcelain.sh
test-emacs-core: ## Run the Elisp core ERT suite (Emacs only, no magit)
PATH="$(CURDIR)/bin:$$PATH" emacs -Q --batch -L share/git-issue/emacs -l ert -l contrib/emacs/test/git-issue-test.el -f ert-run-tests-batch-and-exit
test-emacs-ui: ## Run the magit UI ERT suite (downloads magit into a scratch dir)
chmod +x contrib/emacs/test/run-ui-tests.sh
./contrib/emacs/test/run-ui-tests.sh
bench-deps:
@echo "Running dependency benchmark..."
chmod +x tests/bench_deps.sh
./tests/bench_deps.sh $(COUNT)
test-all: test-unit test-integration test test-deps test-content-safety test-dispatch test-layout test-flags test-registry test-porcelain test-emacs-core
# Single source of the release version: VERSION, the GIT_ISSUE_VERSION
# constant in bin/git-issue, and every man page .TH line must agree.
# Usage: make bump VERSION=1.0.0
.PHONY: bump
bump:
@test -n "$(VERSION)" || { echo "usage: make bump VERSION=x.y.z"; exit 1; }
@printf '%s\n' "$(VERSION)" > VERSION
@sed -e 's/^GIT_ISSUE_VERSION=".*"$$/GIT_ISSUE_VERSION="$(VERSION)"/' bin/git-issue > bin/git-issue.bump.tmp
@mv bin/git-issue.bump.tmp bin/git-issue
@chmod 755 bin/git-issue
@d=`date +%Y-%m-%d`; \
for m in man/man1/*.1 man/man8/*.8; do \
sed -e "s/^\(\.TH [^\"]*\)\"[^\"]*\" \"git-issue [^\"]*\"/\1\"$$d\" \"git-issue $(VERSION)\"/" "$$m" > "$$m.bump.tmp"; \
mv "$$m.bump.tmp" "$$m"; \
done
@echo "bumped to $(VERSION):"
@grep -h '^GIT_ISSUE_VERSION=' bin/git-issue
@head -1 man/man1/git-issue.1
clean:
@echo "Cleaning up..."
find . -name "*.tmp" -delete
find . -name "*~" -delete
# MCP Server targets
build-mcp:
@echo "Building MCP server..."
@if command -v npm >/dev/null 2>&1; then \
cd mcp && npm install && npm run build; \
echo "✅ MCP server built successfully"; \
else \
echo "❌ npm not found - please install Node.js to build MCP server"; \
exit 1; \
fi
install-mcp: build-mcp
@echo "Installing MCP server..."
@if command -v npm >/dev/null 2>&1; then \
cd mcp && npm install --global; \
echo "✅ MCP server installed globally as 'git-issue-mcp-server'"; \
echo ""; \
echo "To use with Claude Desktop, add to your config:"; \
echo '{'; \
echo ' "mcpServers": {'; \
echo ' "git-issue": {'; \
echo ' "command": "git-issue-mcp-server"'; \
echo ' }'; \
echo ' }'; \
echo '}'; \
else \
echo "❌ npm not found - please install Node.js"; \
exit 1; \
fi
uninstall-mcp:
@echo "Uninstalling MCP server..."
@if command -v npm >/dev/null 2>&1; then \
npm uninstall --global git-issue-mcp-server; \
echo "✅ MCP server uninstalled"; \
else \
echo "❌ npm not found"; \
fi
test-mcp: build-mcp
@echo "Testing MCP server..."
@if command -v npm >/dev/null 2>&1; then \
cd mcp && npm test; \
echo "✅ MCP server tests passed"; \
else \
echo "❌ npm not found"; \
exit 1; \
fi
clean-mcp:
@echo "Cleaning MCP server build..."
rm -rf mcp/dist mcp/node_modules
@echo "✅ MCP server cleaned"
.PHONY: help
help:
@echo "git-issue Makefile"
@echo ""
@echo "Core Targets:"
@echo " install Install git-issue to $(PREFIX)"
@echo " uninstall Remove git-issue from system"
@echo " test Test installation"
@echo " clean Clean up temporary files"
@echo ""
@echo "MCP Server Targets:"
@echo " build-mcp Build MCP server (requires Node.js)"
@echo " install-mcp Install MCP server globally"
@echo " uninstall-mcp Remove MCP server"
@echo " test-mcp Test MCP server"
@echo " clean-mcp Clean MCP build files"
@echo ""
@echo " help Show this help"
@echo ""
@echo "Variables:"
@echo " PREFIX Installation prefix (default: /usr/local)"