-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjustfile
More file actions
184 lines (144 loc) · 4.28 KB
/
justfile
File metadata and controls
184 lines (144 loc) · 4.28 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# SPDX-FileCopyrightText: 2023 Shun Sakai
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
alias lint := clippy
# Run default recipe
_default:
just -l
# Build packages
build:
cargo build
# Remove generated artifacts
clean:
cargo clean
# Check packages
check:
cargo check --all-features
# Run tests
test:
cargo test -p abcrypt -p abcrypt-cli -p abcrypt-capi --all-features
# Run benchmarks
bench:
cargo +nightly bench -p abcrypt
# Run the formatter
fmt:
cargo +nightly fmt
# Run the linter
clippy:
cargo +nightly clippy --all-features -- -D warnings
# Apply lint suggestions
clippy-fix:
cargo +nightly clippy --all-features --fix --allow-dirty --allow-staged -- -D warnings
# Build the library package documentation
doc $RUSTDOCFLAGS="--cfg docsrs":
cargo +nightly doc -p abcrypt --all-features
# Configure the Meson project
[working-directory("crates/capi/examples")]
setup-meson:
cargo build -p abcrypt-capi
meson setup builddir
# Build examples for the C API
[working-directory("crates/capi/examples")]
build-capi-examples: setup-meson
meson compile -C builddir
# Run clang-format
[working-directory("crates/capi/examples")]
clang-format: setup-meson
ninja -C builddir clang-format
# Run clang-tidy
[working-directory("crates/capi/examples")]
clang-tidy: setup-meson
ninja -C builddir clang-tidy
# Run tests for the Wasm bindings
wasm-test:
wasm-pack test --node crates/wasm
# Build examples for the Wasm bindings
build-wasm-examples:
wasm-pack build -t deno crates/wasm
# Run `deno fmt`
[working-directory("crates/wasm")]
fmt-wasm-examples:
deno fmt deno.jsonc examples/*.ts
# Run `deno lint`
[working-directory("crates/wasm")]
lint-wasm-examples:
deno lint examples/*.ts
# Run `deno check`
[working-directory("crates/wasm")]
type-check-wasm-examples:
deno check examples/*.ts
# Configure a development environment for the Python bindings
[working-directory("crates/python")]
setup-python:
uv sync
# Run tests for the Python bindings
[working-directory("crates/python")]
python-test:
uv run pytest
# Run the formatter for the Python bindings
[working-directory("crates/python")]
python-fmt:
uv run ruff format .
# Run the linter for the Python bindings
[working-directory("crates/python")]
python-lint:
uv run ruff check .
# Apply lint suggestions for the Python bindings
[working-directory("crates/python")]
python-lint-fix:
uv run ruff check --fix .
# Run the type checker for the Python bindings
[working-directory("crates/python")]
python-type-check:
uv run ty check
# Build man pages
build-man: build-man1 build-man3 build-man5
# Build man pages in section 1
build-man1:
asciidoctor -b manpage docs/man/man1/*.1.adoc
# Build man pages in section 3
build-man3:
asciidoctor -b manpage docs/man/man3/*.3.adoc
# Build `abcrypt(5)`
build-man5:
asciidoctor -b manpage docs/man/man5/abcrypt.5.adoc
# Run the linter for GitHub Actions workflow files
lint-github-actions:
actionlint -verbose
# Run the formatter for the README
fmt-readme:
npx prettier -w crates/*/README.md
# Build the book
build-book:
npx antora antora-playbook.yml
# Build the Wasm bindings
[working-directory("crates/wasm")]
build-wasm $CARGO_PROFILE_RELEASE_CODEGEN_UNITS="1" $CARGO_PROFILE_RELEASE_STRIP="true":
wasm-pack build -s sorairolake -t nodejs --release
# Publish the Wasm bindings
[working-directory("crates/wasm")]
publish-wasm: build-wasm
wasm-pack publish -a public
# Increment the version of the library
[working-directory("crates/abcrypt")]
bump-lib part:
bump-my-version bump {{ part }}
cargo set-version --bump {{ part }} -p abcrypt
# Increment the version of the command-line utility
[working-directory("crates/cli")]
bump-cli part:
bump-my-version bump {{ part }}
cargo set-version --bump {{ part }} -p abcrypt-cli
# Increment the version of the C API
[working-directory("crates/capi")]
bump-capi part:
bump-my-version bump {{ part }}
cargo set-version --bump {{ part }} -p abcrypt-capi
# Increment the version of the Wasm bindings
[working-directory("crates/wasm")]
bump-wasm part:
cargo set-version --bump {{ part }} -p abcrypt-wasm
# Increment the version of the Python bindings
[working-directory("crates/python")]
bump-python part:
cargo set-version --bump {{ part }} -p abcrypt-py