# QuickApp Makefile
# Build automation for QuickApp framework

.PHONY: help docs test build clean install-hooks

# Default target
help:
	@echo "QuickApp Build Commands:"
	@echo "  make docs          - Generate skills documentation"
	@echo "  make test          - Run all tests"
	@echo "  make build         - Build the project"
	@echo "  make clean         - Clean build artifacts"
	@echo "  make install-hooks - Install git pre-commit hooks"
	@echo "  make all           - Run docs, test, and build"

# Generate skills documentation
docs:
	@echo "Generating skills documentation..."
	@dart run bin/quickapp.dart docs generate
	@echo "✓ Documentation generated"

# Run tests
test:
	@echo "Running tests..."
	@dart test
	@echo "✓ Tests passed"

# Build the project
build: docs
	@echo "Building project..."
	@dart pub get
	@dart analyze
	@echo "✓ Build complete"

# Clean build artifacts
clean:
	@echo "Cleaning build artifacts..."
	@rm -rf .dart_tool/
	@rm -rf build/
	@echo "✓ Clean complete"

# Install git pre-commit hooks
install-hooks:
	@echo "Installing git pre-commit hooks..."
	@cp tool/pre-commit .git/hooks/pre-commit
	@chmod +x .git/hooks/pre-commit
	@echo "✓ Pre-commit hook installed"

# Run all build steps
all: docs test build
	@echo "✓ All build steps complete"
