Improve Makefile output and update pre-commit config

Added colored echo statements to Makefile targets for clearer output and improved developer experience. Updated commitizen hook in .pre-commit-config.yaml to v4.9.1 for latest features and fixes.
This commit is contained in:
amithkoujalgi 2025-09-17 11:56:57 +05:30
parent cae8b6e1e4
commit 2f83a5c98c
No known key found for this signature in database
GPG Key ID: E29A37746AF94B70
2 changed files with 33 additions and 21 deletions

View File

@ -21,7 +21,7 @@ repos:
# for commit message formatting
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.9.0
rev: v4.9.1
hooks:
- id: commitizen
stages: [commit-msg]

View File

@ -2,49 +2,61 @@ dev:
@echo "Setting up dev environment..."
@command -v pre-commit >/dev/null 2>&1 || { echo "Error: pre-commit is not installed. Please install it first."; exit 1; }
@command -v docker >/dev/null 2>&1 || { echo "Error: docker is not installed. Please install it first."; exit 1; }
pre-commit install
pre-commit autoupdate
pre-commit install --install-hooks
#pre-commit run --all-files
apply-formatting:
mvn spotless:apply
@pre-commit install
@pre-commit autoupdate
@pre-commit install --install-hooks
check-formatting:
mvn spotless:check
@echo "\033[0;34mChecking code formatting...\033[0m"
@mvn spotless:check
apply-formatting:
@echo "\033[0;32mApplying code formatting...\033[0m"
@mvn spotless:apply
# pre-commit run --all-files
build:
mvn -B clean install -Dgpg.skip=true
@echo "\033[0;34mBuilding project (GPG skipped)...\033[0m"
@mvn -B clean install -Dgpg.skip=true
full-build:
mvn -B clean install
@echo "\033[0;34mPerforming full build...\033[0m"
@mvn -B clean install
unit-tests:
mvn clean test -Punit-tests
@echo "\033[0;34mRunning unit tests...\033[0m"
@mvn clean test -Punit-tests
integration-tests:
export USE_EXTERNAL_OLLAMA_HOST=false && mvn clean verify -Pintegration-tests
@echo "\033[0;34mRunning integration tests (local)...\033[0m"
@export USE_EXTERNAL_OLLAMA_HOST=false && mvn clean verify -Pintegration-tests
integration-tests-remote:
export USE_EXTERNAL_OLLAMA_HOST=true && export OLLAMA_HOST=http://192.168.29.223:11434 && mvn clean verify -Pintegration-tests -Dgpg.skip=true
@echo "\033[0;34mRunning integration tests (remote)...\033[0m"
@export USE_EXTERNAL_OLLAMA_HOST=true && export OLLAMA_HOST=http://192.168.29.223:11434 && mvn clean verify -Pintegration-tests -Dgpg.skip=true
doxygen:
doxygen Doxyfile
@echo "\033[0;34mGenerating documentation with Doxygen...\033[0m"
@doxygen Doxyfile
list-releases:
curl 'https://central.sonatype.com/api/internal/browse/component/versions?sortField=normalizedVersion&sortDirection=desc&page=0&size=20&filter=namespace%3Aio.github.ollama4j%2Cname%3Aollama4j' \
@echo "\033[0;34mListing latest releases...\033[0m"
@curl 'https://central.sonatype.com/api/internal/browse/component/versions?sortField=normalizedVersion&sortDirection=desc&page=0&size=20&filter=namespace%3Aio.github.ollama4j%2Cname%3Aollama4j' \
--compressed \
--silent | jq -r '.components[].version'
docs-build:
cd ./docs && npm install --prefix && npm run build
@echo "\033[0;34mBuilding documentation site...\033[0m"
@cd ./docs && npm install --prefix && npm run build
docs-serve:
cd ./docs && npm install && npm run start
@echo "\033[0;34mServing documentation site...\033[0m"
@cd ./docs && npm install && npm run start
start-cpu:
docker run -it -v ~/ollama:/root/.ollama -p 11434:11434 ollama/ollama
@echo "\033[0;34mStarting Ollama (CPU mode)...\033[0m"
@docker run -it -v ~/ollama:/root/.ollama -p 11434:11434 ollama/ollama
start-gpu:
docker run -it --gpus=all -v ~/ollama:/root/.ollama -p 11434:11434 ollama/ollama
@echo "\033[0;34mStarting Ollama (GPU mode)...\033[0m"
@docker run -it --gpus=all -v ~/ollama:/root/.ollama -p 11434:11434 ollama/ollama