-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (61 loc) · 2.41 KB
/
Makefile
File metadata and controls
79 lines (61 loc) · 2.41 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Set the default target of this Makefile
.PHONY: all
all:: ci ## Default target, runs the CI process
.PHONY: check-fmt
check-fmt: ## Check code formatting
cargo fmt -- --config imports_granularity=Item --config format_code_in_doc_comments=true --check
buf format --diff --exit-code
.PHONY: fmt
fmt: fmt-rust fmt-buf fmt-move ## Format all code (Rust, protobuf, and Move)
.PHONY: fmt-rust
fmt-rust: ## Format Rust code
cargo fmt -- --config imports_granularity=Item --config format_code_in_doc_comments=true
.PHONY: fmt-buf
fmt-buf: ## Format protobuf files
$(MAKE) -C crates/hashi-types buf-fmt
.PHONY: fmt-move
fmt-move: ## Format Move code
prettier-move -w packages/*/sources/*.move
prettier-move -w packages/*/sources/**/*.move
prettier-move -w packages/*/tests/*.move
prettier-move -w packages/*/tests/**/*.move
.PHONY: buf-lint
buf-lint: ## Run buf lint
$(MAKE) -C crates/hashi-types buf-lint
.PHONY: test
test: ## Run all tests
cargo nextest run --workspace --all-features
cargo test --workspace --all-features --doc
.PHONY: test-move
test-move: ## Run all move tests
ls -d packages/*/ | xargs -I {} bash -c "sui move test --path '{}'"
.PHONY: proto
proto: ## Build proto files
$(MAKE) -C crates/hashi-types proto
.PHONY: clippy
clippy: ## run cargo clippy
cargo clippy --workspace --all-features --all-targets
.PHONY: doc
doc: ## Generate documentation
RUSTDOCFLAGS="-Dwarnings --cfg=doc_cfg -Zunstable-options --generate-link-to-definition" RUSTC_BOOTSTRAP=1 cargo doc --workspace --all-features --no-deps
.PHONY: doc-open
doc-open: ## Generate and open documentation
RUSTDOCFLAGS="--cfg=doc_cfg -Zunstable-options --generate-link-to-definition" RUSTC_BOOTSTRAP=1 cargo doc --workspace --all-features --no-deps --open
.PHONY: ci
ci: check-fmt buf-lint clippy test ## Run the full CI process
.PHONY: is-dirty
is-dirty: ## Checks if repository is dirty
@(test -z "$$(git diff)" || (git diff && false)) && (test -z "$$(git status --porcelain)" || (git status --porcelain && false))
.PHONY: clean
clean: ## Clean build artifacts
cargo clean
.PHONY: clean-all
clean-all: clean ## Clean all generated files, including those ignored by Git. Force removal.
git clean -dXf
.PHONY: help
help: ## Show this help
@echo "Available targets:"
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.PHONY: book
book: ## Build and serve the design mdbook
mdbook serve design