-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (63 loc) · 1.79 KB
/
Makefile
File metadata and controls
77 lines (63 loc) · 1.79 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
.PHONY: build run test clean build-mac install uninstall install-deps
# Aggiungi GOPATH/bin al PATH per tool come fyne
export PATH := $(PATH):$(shell go env GOPATH)/bin
# Variabili
BINARY_NAME=mcp-curator
BINARY_DIR=bin
CMD_DIR=./cmd/mcp-manager
APP_NAME=MCP Curator
APP_BUNDLE=$(APP_NAME).app
INSTALL_DIR=/Applications
# Build per la piattaforma corrente
build:
@mkdir -p $(BINARY_DIR)
go build -o $(BINARY_DIR)/$(BINARY_NAME) $(CMD_DIR)
# Esegui l'applicazione
run:
go run $(CMD_DIR)
# Build per macOS come .app bundle
build-mac:
fyne package --target darwin --icon $(CURDIR)/assets/icon.png --name "$(APP_NAME)" --src $(CMD_DIR)
# Installa l'app in /Applications (richiede privilegi admin se necessario)
install: build-mac
@echo "Installazione $(APP_BUNDLE) in $(INSTALL_DIR)..."
@if [ -d "$(INSTALL_DIR)/$(APP_BUNDLE)" ]; then \
echo "Rimozione versione precedente..."; \
rm -rf "$(INSTALL_DIR)/$(APP_BUNDLE)"; \
fi
@cp -R "$(APP_BUNDLE)" "$(INSTALL_DIR)/"
@echo "Installazione completata: $(INSTALL_DIR)/$(APP_BUNDLE)"
# Disinstalla l'app da /Applications
uninstall:
@if [ -d "$(INSTALL_DIR)/$(APP_BUNDLE)" ]; then \
echo "Rimozione $(APP_BUNDLE) da $(INSTALL_DIR)..."; \
rm -rf "$(INSTALL_DIR)/$(APP_BUNDLE)"; \
echo "Disinstallazione completata."; \
else \
echo "$(APP_BUNDLE) non trovata in $(INSTALL_DIR)."; \
fi
# Test
test:
go test -v ./...
# Test con coverage
test-coverage:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
# Pulisci build artifacts
clean:
rm -rf $(BINARY_DIR)
rm -f coverage.out coverage.html
rm -rf "MCP Curator.app"
# Installa dipendenze
install-deps:
go mod download
go mod tidy
# Formatta codice
fmt:
go fmt ./...
# Lint
lint:
golangci-lint run
# Verifica compilazione
check:
go build -o /dev/null $(CMD_DIR)