dev:
cargo run
release:
cargo build --release
build:
./build.sh
test:
cargo test
test-verbose:
cargo test -- --nocapture
clean:
cargo clean
fmt:
cargo fmt
fmt-fix:
cargo fmt --all
lint:
cargo clippy
lint-fix:
cargo clippy --fix --allow-dirty
check: fmt lint test
install: release
@echo "π¦ Installing ai-context-gen to /usr/local/bin/"
@if [ -f "target/release/ai-context-gen" ]; then \
sudo cp target/release/ai-context-gen /usr/local/bin/; \
echo "β
Installation completed successfully!"; \
echo "π You can now use 'ai-context-gen' from anywhere"; \
else \
echo "β Release binary not found. Run 'make release' first."; \
exit 1; \
fi
uninstall:
@echo "ποΈ Removing ai-context-gen from /usr/local/bin/"
@sudo rm -f /usr/local/bin/ai-context-gen
@echo "β
Uninstallation completed"
demo:
@echo "π Running AI Context Generator demo..."
@echo "π Analyzing current directory..."
@echo "Press Ctrl+C to exit"
cargo run
example-basic:
@echo "π§ͺ Running basic usage example..."
cargo run --example basic_usage
example-advanced:
@echo "π§ͺ Running advanced usage example..."
cargo run --example advanced_usage
examples: example-basic example-advanced
help:
cargo run -- --help
info:
@echo "π AI Context Generator Project Information"
@echo "Name: ai-context-gen"
@echo "Version: $(shell grep '^version' Cargo.toml | head -1 | cut -d'"' -f2)"
@echo "Rust Edition: $(shell grep '^edition' Cargo.toml | cut -d'"' -f2)"
@echo "Build Type: $(if $(wildcard target/release/ai-context-gen),Release,Debug)"
publish-check:
@echo "π Checking crate for publishing..."
cargo check --all-targets
cargo clippy --all-targets -- -D warnings
cargo test
cargo doc --no-deps
publish-dry-run:
@echo "π§ͺ Performing dry-run publish..."
cargo publish --dry-run
publish:
@echo "π¦ Publishing crate to crates.io..."
@echo "β οΈ Make sure you have incremented the version in Cargo.toml"
@read -p "Are you sure you want to publish? [y/N] " confirm && [ "$$confirm" = "y" ]
cargo publish
docs:
@echo "π Building documentation..."
cargo doc --no-deps --open
docs-private:
@echo "π Building documentation (including private items)..."
cargo doc --no-deps --document-private-items --open
version-patch:
@echo "π’ Bumping patch version..."
@current_version=$$(grep '^version' Cargo.toml | head -1 | cut -d'"' -f2); \
IFS='.' read -ra parts <<< "$$current_version"; \
new_version="$${parts[0]}.$${parts[1]}.$$((parts[2] + 1))"; \
sed -i "s/^version = \"$$current_version\"/version = \"$$new_version\"/" Cargo.toml; \
echo "Version updated from $$current_version to $$new_version"
version-minor:
@echo "π’ Bumping minor version..."
@current_version=$$(grep '^version' Cargo.toml | head -1 | cut -d'"' -f2); \
IFS='.' read -ra parts <<< "$$current_version"; \
new_version="$${parts[0]}.$$((parts[1] + 1)).0"; \
sed -i "s/^version = \"$$current_version\"/version = \"$$new_version\"/" Cargo.toml; \
echo "Version updated from $$current_version to $$new_version"
version-major:
@echo "π’ Bumping major version..."
@current_version=$$(grep '^version' Cargo.toml | head -1 | cut -d'"' -f2); \
IFS='.' read -ra parts <<< "$$current_version"; \
new_version="$$((parts[0] + 1)).0.0"; \
sed -i "s/^version = \"$$current_version\"/version = \"$$new_version\"/" Cargo.toml; \
echo "Version updated from $$current_version to $$new_version"
crate-info:
@echo "π AI Context Generator - Crate Information"
@echo "============================================"
@echo "Name: $(shell grep '^name' Cargo.toml | head -1 | cut -d'"' -f2)"
@echo "Version: $(shell grep '^version' Cargo.toml | head -1 | cut -d'"' -f2)"
@echo "Edition: $(shell grep '^edition' Cargo.toml | cut -d'"' -f2)"
@echo "License: $(shell grep '^license' Cargo.toml | cut -d'"' -f2)"
@echo "Description: $(shell grep '^description' Cargo.toml | cut -d'"' -f2)"
@echo ""
@echo "π¦ Targets disponΓveis:"
@echo " - Binary: ai-context-gen"
@echo " - Library: ai-context-gen"
help-make:
@echo "π§ AI Context Generator - Available Make Targets"
@echo "================================================="
@echo ""
@echo "π Development:"
@echo " dev - Build and run in development mode"
@echo " demo - Run demo with current directory"
@echo " help - Show application help"
@echo " examples - Run all examples"
@echo " example-basic - Run basic usage example"
@echo " example-advanced - Run advanced usage example"
@echo ""
@echo "ποΈ Building:"
@echo " build - Build using build script (recommended)"
@echo " release - Build optimized release version"
@echo ""
@echo "π§ͺ Testing & Quality:"
@echo " test - Run tests"
@echo " test-verbose - Run tests with verbose output"
@echo " check - Run format, lint and test checks"
@echo ""
@echo "π¨ Code Quality:"
@echo " fmt - Check code formatting"
@echo " fmt-fix - Apply automatic formatting"
@echo " lint - Check linting"
@echo " lint-fix - Apply linting fixes"
@echo ""
@echo "π¦ Installation:"
@echo " install - Install to system PATH"
@echo " uninstall - Remove from system"
@echo ""
@echo "π Documentation:"
@echo " docs - Build and open documentation"
@echo " docs-private - Build docs including private items"
@echo ""
@echo "π Publishing:"
@echo " publish-check - Check crate for publishing"
@echo " publish-dry-run - Perform dry-run publish"
@echo " publish - Publish to crates.io"
@echo ""
@echo "π’ Version Management:"
@echo " version-patch - Bump patch version (0.0.X)"
@echo " version-minor - Bump minor version (0.X.0)"
@echo " version-major - Bump major version (X.0.0)"
@echo ""
@echo "π§Ή Maintenance:"
@echo " clean - Clean all build artifacts"
@echo " info - Show project information"
@echo " crate-info - Show crate-specific information"
@echo " help-make - Show this help"
@echo ""
.PHONY: dev release build test test-verbose clean fmt fmt-fix lint lint-fix check install uninstall demo help info help-make publish-check publish-dry-run publish docs docs-private version-patch version-minor version-major crate-info example-basic example-advanced examples