.DEFAULT_GOAL := build

t :=

.PHONY: build
build: target/doc
	cargo build

.PHONY: test
test: target/doc
	. ./.env.test && cargo test --color always $(t) -- --nocapture

target/doc:
	cargo doc

.PHONY: lint
lint: target/doc
	cargo +nightly clippy -- -Wclippy::pedantic

.PHONY: example
example: target/doc
	. ./.env && RUST_BACKTRACE=1 cargo run --example awaiting_review

# Run this before publishing, to make sure the publish will work.
.PHONY: prepublish
prepublish: test
	cargo publish --dry-run

.PHONY: publish
publish: prepublish
	verto
	cargo publish
