-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (27 loc) · 1009 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.PHONY: test # Run the full test suite.
test:
@cargo test
.git/hooks/pre-commit:
@printf "#!/bin/sh\nmake lint\n" > $@
@chmod +x $@
.PHONY: lint # Lint the project
lint: .pre-commit-config.yaml
@pre-commit run --show-diff-on-failure --color=always --all-files
.PHONY: cover # Run cover tests and generate & open a report.
cover:
@./.ci/test-cover
.PHONY: docs # Generate and open cargo docs.
docs: target/doc/pgxn_build/index.html
open $<
.PHONY: update-deps # Update dependencies to the latest versions.
update-deps:
cargo upgrade -i allow && cargo update
target/doc/pgxn_build/index.html: $(shell find . -name \*.rs)
cargo doc
VERSION = $(shell perl -nE '/^version\s*=\s*"([^"]+)/ && do { say $$1; exit }' Cargo.toml)
.PHONY: release-notes # Show release notes for current version (must have `mknotes` in PATH).
release-notes: CHANGELOG.md
mknotes -v v$(VERSION) -f $< -r https://github.com/$(or $(GITHUB_REPOSITORY),pgxn/meta)
.PHONY: clean # Remove generated files
clean:
@rm -rf target