.PHONY: help install install-dev test lint format type clean build-windows build-macos docs

help:
	@echo "WebDrop Bridge - Development Commands"
	@echo "======================================"
	@echo ""
	@echo "Setup:"
	@echo "  make install           Install production dependencies"
	@echo "  make install-dev       Install development dependencies"
	@echo ""
	@echo "Testing:"
	@echo "  make test              Run all tests with coverage"
	@echo "  make test-quick        Run tests without coverage"
	@echo "  make test-unit         Run unit tests only"
	@echo "  make test-integration  Run integration tests only"
	@echo ""
	@echo "Code Quality:"
	@echo "  make lint              Run linting checks (ruff, black)"
	@echo "  make format            Auto-format code (black, isort)"
	@echo "  make type              Run type checking (mypy)"
	@echo "  make quality           Run all quality checks (lint, type, test)"
	@echo ""
	@echo "Building:"
	@echo "  make build-windows     Build Windows executable"
	@echo "  make build-macos       Build macOS DMG"
	@echo "  make clean             Remove build artifacts"
	@echo ""
	@echo "Documentation:"
	@echo "  make docs              Build Sphinx documentation"
	@echo ""

install:
	pip install -r requirements.txt

install-dev:
	pip install -r requirements-dev.txt

test:
	pytest tests -v --cov=src/webdrop_bridge --cov-report=html

test-quick:
	pytest tests -v

test-unit:
	pytest tests/unit -v

test-integration:
	pytest tests/integration -v

lint:
	ruff check src tests
	black --check src tests
	isort --check-only src tests

format:
	black src tests
	isort src tests
	ruff check --fix src tests

type:
	mypy src/webdrop_bridge

quality: lint type test

clean:
	rm -rf build/dist build/temp build/specs
	rm -rf htmlcov .coverage .pytest_cache
	rm -rf .mypy_cache .ruff_cache
	find . -type d -name __pycache__ -exec rm -rf {} +
	find . -type f -name "*.pyc" -delete
	find . -type f -name "*.pyo" -delete

build-windows:
	python build/scripts/build_windows.py

build-macos:
	bash build/scripts/build_macos.sh

docs:
	cd docs && sphinx-build -W -b html -d _build/doctrees . _build/html

.DEFAULT_GOAL := help
