xref: /plugin/deletepageguard/Makefile (revision 9a383d51b90310842e2a3f0f9d693178d0875b32)
1# Delete Page Guard Plugin - Developer Tools
2#
3# Professional Makefile for development, testing, and release management
4
5.PHONY: test check clean dist release version help
6
7# Default target
8help:
9	@echo "Delete Page Guard Plugin - Developer Tools"
10	@echo "=========================================="
11	@echo ""
12	@echo "Development targets:"
13	@echo "  test    - Run the test suite"
14	@echo "  check   - Check PHP syntax of all files"
15	@echo "  clean   - Clean temporary files"
16	@echo ""
17	@echo "Release targets:"
18	@echo "  version [VERSION=x.y.z] - Update version in all files"
19	@echo "  dist    - Create distribution ZIP file"
20	@echo "  release [VERSION=x.y.z]  - Complete release workflow"
21	@echo ""
22	@echo "Utility targets:"
23	@echo "  status  - Show current version and git status"
24	@echo "  help    - Show this help message"
25
26# Run the test suite
27test:
28	@echo "Running test suite..."
29	php tests/test_runner.php
30
31# Check syntax of all PHP files
32check:
33	@echo "Checking PHP syntax..."
34	@find . -name "*.php" -not -path "./tests/*" -exec php -l {} \;
35	@echo "Syntax check complete."
36
37# Clean temporary files and build artifacts
38clean:
39	@echo "Cleaning temporary files and build artifacts..."
40	@find . -name "*~" -delete
41	@find . -name "*.tmp" -delete
42	@rm -rf dist/
43	@echo "Clean complete."
44
45# Update version in all files
46version:
47ifndef VERSION
48	@echo "Error: VERSION parameter required"
49	@echo "Usage: make version VERSION=1.2.3"
50	@exit 1
51endif
52	@echo "Updating version to $(VERSION)..."
53	php build/update-version.php $(VERSION)
54	@echo "Version update complete."
55
56# Create distribution ZIP file
57dist: check test
58	@echo "Creating distribution package..."
59	php build/create-dist.php
60
61# Complete release workflow
62release: check test
63ifndef VERSION
64	@echo "Error: VERSION parameter required"
65	@echo "Usage: make release VERSION=1.2.3"
66	@exit 1
67endif
68	@echo "Starting release workflow for version $(VERSION)..."
69	@make version VERSION=$(VERSION)
70	@echo "Please update CHANGELOG.md with release notes, then run:"
71	@echo "  git add -A"
72	@echo "  git commit -m 'Release version $(VERSION)'"
73	@echo "  git tag v$(VERSION)"
74	@echo "  make dist"
75	@echo "  git push origin main --tags"
76
77# Show current status
78status:
79	@php build/show-status.php
80	@echo "Git status:"
81	@git status --short || echo "Not a git repository"