-
Notifications
You must be signed in to change notification settings - Fork 135
Expand file tree
/
Copy pathMakefile
More file actions
90 lines (70 loc) · 2.84 KB
/
Copy pathMakefile
File metadata and controls
90 lines (70 loc) · 2.84 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
.PHONY: fmt fmt-check lint-wasi-targets test-wasi-targets wasi-targets lint-native-targets test-native-targets native-targets test-wpt test clean cli plugin build-test-plugins build-default-plugin
.DEFAULT_GOAL := cli
# === Format checks ===
fmt-check:
cargo fmt --all --check
fmt:
cargo fmt --all
# === Lint & Test WASI Targets ===
lint-wasi-targets:
cargo clippy --workspace \
--exclude=javy-cli \
--exclude=javy-codegen \
--exclude=javy-plugin-processing \
--exclude=javy-runner \
--exclude=javy-fuzz \
--target=wasm32-wasip2 --all-targets --all-features -- -D warnings
test-wasi-targets:
cargo hack test --workspace \
--exclude=javy-cli \
--exclude=javy-codegen \
--exclude=javy-plugin-processing \
--exclude=javy-runner \
--exclude=javy-fuzz \
--exclude=javy-test-plugin-wasip2 \
--exclude=javy-test-invalid-plugin \
--target=wasm32-wasip2 --each-feature -- --nocapture
wasi-targets: lint-wasi-targets test-wasi-targets
# === Lint & Test Native Targets ===
lint-native-targets: build-default-plugin
CARGO_PROFILE_RELEASE_LTO=off cargo clippy --workspace \
--exclude=javy \
--exclude=javy-plugin-api \
--exclude=javy-plugin \
--exclude=javy-test-plugin-wasip2 \
--release --all-targets --all-features -- -D warnings
test-native-targets: build-default-plugin build-test-plugins
CARGO_PROFILE_RELEASE_LTO=off cargo hack test --workspace \
--exclude=javy \
--exclude=javy-plugin-api \
--exclude=javy-plugin \
--exclude=javy-test-plugin-wasip2 \
--release --each-feature -- --nocapture
native-targets: lint-native-targets test-native-targets
# === Web Platform Tests
test-wpt: cli
npm install --prefix wpt
npm test --prefix wpt
# === All tests ===
test-all: wasi-targets native-targets test-wpt
# === Binaries ===
# First, build the default plugin, which is a dependency to the CLI.
# No need to run `javy_plugin_processing`, the CLI build.rs will take
# care of doing that.
target/release/javy: build-default-plugin
CARGO_PROFILE_RELEASE_LTO=off cargo build -p=javy-cli --release
target/wasm32-wasip2/release/plugin.wasm:
cargo build -p=javy-plugin --target=wasm32-wasip2 --release
target/wasm32-wasip2/release/test_plugin.wasm:
cargo build -p=javy-test-plugin-wasip2 --target=wasm32-wasip2 --release
cargo run --package=javy-plugin-processing --release -- target/wasm32-wasip2/release/test_plugin.wasm target/wasm32-wasip2/release/test_plugin.wasm
target/wasm32-unknown-unknown/release/test_invalid_plugin.wasm:
cargo build -p=javy-test-invalid-plugin --target=wasm32-unknown-unknown --release
cli: target/release/javy
# Build the default plugin
build-default-plugin: target/wasm32-wasip2/release/plugin.wasm
# Build auxiliary plugins, for testing
build-test-plugins: target/wasm32-wasip2/release/plugin.wasm target/wasm32-wasip2/release/test_plugin.wasm target/wasm32-unknown-unknown/release/test_invalid_plugin.wasm
# === Misc ===
clean:
cargo clean