Files
cursebreaker-parser-rust/Makefile
2025-12-30 12:16:52 +09:00

81 lines
2.4 KiB
Makefile

# Unity Parser Build and Test Automation
# Cross-platform Makefile
.PHONY: default setup-test build test test-cursebreaker test-unit run run-cursebreaker clean clean-all ci dev help
# Default target
default: test
# Setup test projects (git submodules)
setup-test:
@echo "Setting up test Unity projects..."
call scripts\setup-test-project.bat
# Build in release mode
build:
cargo build --release
# Run tests with test projects (integration tests)
test: setup-test
@echo "Running tests with test projects..."
cargo test --lib -- --nocapture
# Run tests with Cursebreaker project (large)
test-cursebreaker:
@echo "Running tests with Cursebreaker project..."
@TEST_PROJECT_PATH="c:/Repos/CBAssets" cargo test --lib -- --nocapture
# Run unit tests only (no integration tests)
test-unit:
cargo test --lib -- --nocapture
# Run CLI tool with first available test project
run: build
.\target\release\cursebreaker-parser.exe scan --project "data/tests/unity-sampleproject/PiratePanic"
# Run CLI tool with Cursebreaker project
run-cursebreaker: build
./target/release/cursebreaker-parser scan --project "c:/Repos/CBAssets"
# Clean build artifacts
clean:
cargo clean
# Clean everything including test projects
clean-all:
cargo clean
git submodule deinit -f --all
@if [ -d "data/tests" ]; then \
if command -v rmdir >/dev/null 2>&1 && [ "$$(uname -s)" = "Windows_NT" ]; then \
rmdir /s /q data/tests 2>/dev/null || true; \
else \
rm -rf data/tests; \
fi; \
fi
# Full CI pipeline
ci: clean setup-test build test
# Development workflow
dev: setup-test
cargo build
cargo test --lib
# Show available targets
help:
@echo "Unity Parser Build and Test Automation"
@echo ""
@echo "Available targets:"
@echo " setup-test - Initialize git submodules for test projects"
@echo " build - Build in release mode"
@echo " test - Run all tests (with test projects)"
@echo " test-unit - Run unit tests only (no integration)"
@echo " test-cursebreaker - Run tests with Cursebreaker project"
@echo " run - Run CLI with test project"
@echo " run-cursebreaker - Run CLI with Cursebreaker project"
@echo " clean - Clean build artifacts"
@echo " clean-all - Clean everything including test projects"
@echo " ci - Full CI pipeline (clean + setup + build + test)"
@echo " dev - Development workflow (setup + build + test)"
@echo " help - Show this help message"