-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (65 loc) · 3.46 KB
/
Makefile
File metadata and controls
77 lines (65 loc) · 3.46 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
# Download all dependencies for offline use
default: build
.PHONY: build clean release test sync verify format default
# Load version from VERSION file
SPRING_VISION_VERSION := $(shell cat VERSION)
# Local simulation repo and signing control (can be overridden on the make command line)
LOCAL_REPO ?= $(CURDIR)/target/local-repo
GPG_SKIP ?= true
clean:
mvn clean -q
build:
@echo "Building project: Maven install - Version: $(SPRING_VISION_VERSION)";
mvn versions:set -DnewVersion=$(SPRING_VISION_VERSION) -DgenerateBackupPoms=false -DprocessAllModules=true;
mvn clean install -DskipTests -Dgpg.skip=$(GPG_SKIP) -Pdownload-models || ( echo "Maven install failed!" && exit 1 );
run:
@echo "Running Spring Vision MCP server locally with JBang";
# Ensure the project is built
$(MAKE) build || ( echo "Build failed" && exit 1 );
# Run the MCP server using JBang runner
jbang run.java;
release:
@echo "Releasing all modules to GitHub Packages with version $(SPRING_VISION_VERSION)..."; \
# Delete local tag if it exists (to overwrite it)
git tag -d v$(SPRING_VISION_VERSION) 2>/dev/null || true; \
# Create annotated git tag
git tag -a v$(SPRING_VISION_VERSION) -m "Release v$(SPRING_VISION_VERSION)"; \
# Check if tag exists in remote and force push if needed
if git ls-remote --tags origin | grep -q "refs/tags/v$(SPRING_VISION_VERSION)"; then \
echo "Tag v$(SPRING_VISION_VERSION) exists in remote, force pushing..."; \
git push --force origin v$(SPRING_VISION_VERSION) || ( echo "Failed to force push tag to origin" && exit 1 ); \
else \
echo "Tag v$(SPRING_VISION_VERSION) does not exist in remote, pushing..."; \
git push origin v$(SPRING_VISION_VERSION) || ( echo "Failed to push tag to origin" && exit 1 ); \
fi
# Run only the DjlVisionBackend integration test
test:
@echo "Running DjlVisionBackend integration tests (core module) and VisionTool integration test (mcp module)..."
# Run only in the core and mcp modules to avoid failing other modules that don't contain these tests
mvn -pl core,mcp -am -q test || \
( echo "Integration tests failed" && exit 1 )
verify: test
@echo "Verifying project with Spotless and Checkstyle..."
mvn spotless:check checkstyle:check -q || ( echo "Verification failed" && exit 1 )
@echo "Verification completed successfully"
format:
@echo "Formatting project with Spotless..."
mvn spotless:apply -q || ( echo "Formatting failed" && exit 1 )
@echo "Formatting completed successfully"
sync:
@echo "Building and syncing MCP jar for local testing..."
# Build the mcp module
mvn -pl mcp clean package -DskipTests -q || ( echo "MCP build failed!" && exit 1 )
# Create the target directory if it doesn't exist
mkdir -p /home/codesapienbe/.springvision
# Copy the compiled jar
cp mcp/target/mcp-$(SPRING_VISION_VERSION).jar /home/codesapienbe/.springvision/mcp-$(SPRING_VISION_VERSION).jar
@echo "MCP jar synced to /home/codesapienbe/.springvision/mcp-$(SPRING_VISION_VERSION).jar"
# Update version in .cursor/mcp.json if it exists
@if [ -f /home/codesapienbe/.cursor/mcp.json ]; then \
echo "Updating version in .cursor/mcp.json..."; \
jq --arg version "$(SPRING_VISION_VERSION)" '.mcpServers."spring-vision".args[0] = "/home/codesapienbe/.springvision/mcp-" + $$version + ".jar"' /home/codesapienbe/.cursor/mcp.json > /tmp/mcp.json.tmp && mv /tmp/mcp.json.tmp /home/codesapienbe/.cursor/mcp.json; \
echo "Updated .cursor/mcp.json with version $(SPRING_VISION_VERSION)"; \
else \
echo ".cursor/mcp.json not found, skipping version update"; \
fi