.PHONY: build test lint clean release check doc

build:
	# v0.94.9 (claude-test 建议): 默认 release 构建,避免堆积 debug 产物(62G 实测清理教训)
	cargo build --workspace --release

release:
	cargo build --release --bin xwcode

test:
	# v0.94.9 (claude-test 建议): 测试一律 release,与 CI/集成验证口径一致
	cargo test --workspace --release

test-api:
	cargo test -p xw-api --release

test-providers:
	cargo test -p xw-providers --release

test-tools:
	cargo test -p xw-tools --release

test-runtime:
	cargo test -p xw-runtime --release

lint:
	cargo fmt --all -- --check
	cargo clippy --all-targets -- -D warnings

fmt:
	cargo fmt --all

clean:
	cargo clean

check:
	cargo check --workspace

doc:
	cargo doc --no-deps --open

install:
	cargo install --path crates/xw-cli

run:
	cargo run -p xw-cli