-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathJustfile
74 lines (65 loc) · 2.79 KB
/
Justfile
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
template_dir := `mktemp -d`
# Lists all available commands.
list:
@just --list
# Builds the library in release mode.
build:
cargo build --release
# Builds the webassembly module.
build-wasm:
cd crates/wasm && wasm-pack build --release --out-dir pkg
# Detects linting problems using rustfmt, clippy, and cargo check.
lint:
cargo +nightly fmt --all -- --check --unstable-features
cargo +nightly clippy --workspace --all-targets --all-features -- -D warnings
cargo +nightly check --workspace --locked
# Fixes linting problems automatically using clippy, cargo fix, and rustfmt.
fix:
cargo +nightly clippy --workspace --all-targets --all-features --fix --allow-dirty --allow-staged
cargo +nightly fix --allow-dirty --allow-staged
cargo +nightly fmt --all -- --unstable-features
# Runs all tests in the workspace.
test:
cargo test --workspace --locked --all-targets
# Publishes all crates to crates.io in the correct order.
publish:
# Note: the order of publishing is important, as some crates depend on others.
cargo publish -p mago-casing --allow-dirty
cargo publish -p mago-php-version --allow-dirty
cargo publish -p mago-fixer --allow-dirty
cargo publish -p mago-trinary --allow-dirty
cargo publish -p mago-interner --allow-dirty
cargo publish -p mago-source --allow-dirty
cargo publish -p mago-span --allow-dirty
cargo publish -p mago-reporting --allow-dirty
cargo publish -p mago-reflection --allow-dirty
cargo publish -p mago-token --allow-dirty
cargo publish -p mago-ast --allow-dirty
cargo publish -p mago-walker --allow-dirty
cargo publish -p mago-traverser --allow-dirty
cargo publish -p mago-ast-utils --allow-dirty
cargo publish -p mago-composer --allow-dirty
cargo publish -p mago-docblock --allow-dirty
cargo publish -p mago-lexer --allow-dirty
cargo publish -p mago-parser --allow-dirty
cargo publish -p mago-formatter --allow-dirty
cargo publish -p mago-names --allow-dirty
cargo publish -p mago-symbol-table --allow-dirty
cargo publish -p mago-semantics --allow-dirty
cargo publish -p mago-reference --allow-dirty
cargo publish -p mago-typing --allow-dirty
cargo publish -p mago-reflector --allow-dirty
cargo publish -p mago-linter --allow-dirty
cargo publish -p mago-wasm --allow-dirty
cargo publish --allow-dirty
# Cleans all build artifacts from the workspace.
clean:
cargo clean --workspace
# Regenerates PHPStorm stubs files from the JetBrains phpstorm-stubs repository.
stubs:
git clone https://github.com/JetBrains/phpstorm-stubs {{template_dir}}
find {{template_dir}}/* -maxdepth 0 -type d -exec cp -r {} stubs \;
cp {{template_dir}}/LICENSE stubs/
rm -rf stubs/tests
find stubs -name ".phpstorm.meta.php" -delete
rm -rf {{template_dir}}