-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathpixi.toml
More file actions
73 lines (64 loc) · 4.15 KB
/
Copy pathpixi.toml
File metadata and controls
73 lines (64 loc) · 4.15 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
[workspace]
authors = ["ehsanmok <ehsanmok@users.noreply.github.com>"]
channels = ["conda-forge"]
name = "create-your-own-lang-with-rust"
platforms = ["osx-arm64", "linux-64"]
version = "1.0.0"
[dependencies]
rust = ">=1.83.0,<2"
mdbook = ">=0.4.40,<0.5"
[tasks]
# mdbook-linkcheck is not bundled with mdbook; install it once before `linkcheck`.
install-linkcheck = "cargo install mdbook-linkcheck"
book-build = { cmd = "mdbook build", cwd = "book" }
linkcheck = { cmd = "mdbook build", cwd = "book", depends-on = ["install-linkcheck"] }
book = { cmd = "mdbook serve --open", cwd = "book" }
# secondlang and thirdlang need nightly + LLVM; calculator and firstlang run on stable.
test-calculator = "cargo test -p calculator"
test-firstlang = "cargo test -p firstlang"
test-secondlang = "rustup run nightly cargo test -p secondlang"
test-thirdlang = "rustup run nightly cargo test -p thirdlang"
tests = { cmd = "cargo test -p calculator -p firstlang && rustup run nightly cargo test -p secondlang -p thirdlang" }
example-calculator = "cargo run -p calculator --bin main examples/simple.calc"
example-firstlang-fib = "cargo run -p firstlang -- firstlang/examples/fibonacci.fl"
example-firstlang-factorial = "cargo run -p firstlang -- firstlang/examples/factorial.fl"
example-secondlang-fib = "rustup run nightly cargo run -p secondlang -- secondlang/examples/fibonacci.sl"
example-secondlang-factorial = "rustup run nightly cargo run -p secondlang -- secondlang/examples/factorial.sl"
example-secondlang-inference = "rustup run nightly cargo run -p secondlang -- secondlang/examples/inference.sl"
example-thirdlang-point = "rustup run nightly cargo run -p thirdlang --bin thirdlang -- thirdlang/examples/point.tl"
example-thirdlang-counter = "rustup run nightly cargo run -p thirdlang --bin thirdlang -- thirdlang/examples/counter.tl"
example-thirdlang-destructor = "rustup run nightly cargo run -p thirdlang --bin thirdlang -- thirdlang/examples/destructor.tl"
examples = """
cargo run -p calculator --bin main calculator/examples/simple.calc && \
cargo run -p firstlang -- firstlang/examples/basics.fl && \
cargo run -p firstlang -- firstlang/examples/fibonacci.fl && \
cargo run -p firstlang -- firstlang/examples/factorial.fl && \
rustup run nightly cargo run -p secondlang -- secondlang/examples/basics.sl && \
rustup run nightly cargo run -p secondlang -- secondlang/examples/fibonacci.sl && \
rustup run nightly cargo run -p secondlang -- secondlang/examples/factorial.sl && \
rustup run nightly cargo run -p thirdlang --bin thirdlang -- thirdlang/examples/point.tl && \
rustup run nightly cargo run -p thirdlang --bin thirdlang -- thirdlang/examples/counter.tl && \
rustup run nightly cargo run -p thirdlang --bin thirdlang -- thirdlang/examples/destructor.tl && \
rustup run nightly cargo run -p thirdlang --bin thirdlang -- thirdlang/examples/linked_node.tl
"""
format-check = "cargo fmt --all -- --check"
format = "cargo fmt --all"
clippy = "cargo clippy -p calculator -p firstlang -- -D warnings"
clippy-secondlang = "rustup run nightly cargo clippy -p secondlang -- -D warnings"
clippy-thirdlang = "rustup run nightly cargo clippy -p thirdlang -- -D warnings"
clippy-all = { cmd = "cargo clippy -p calculator -p firstlang -- -D warnings && rustup run nightly cargo clippy -p secondlang -p thirdlang -- -D warnings" }
lint = { cmd = "cargo fmt --all -- --check && cargo clippy -p calculator -p firstlang -- -D warnings && rustup run nightly cargo clippy -p secondlang -p thirdlang -- -D warnings" }
build = "cargo build -p calculator -p firstlang"
build-secondlang = "rustup run nightly cargo build -p secondlang"
build-thirdlang = "rustup run nightly cargo build -p thirdlang"
build-all = { cmd = "cargo build -p calculator -p firstlang && rustup run nightly cargo build -p secondlang -p thirdlang" }
ci = { cmd = """
cargo fmt --all -- --check && \
cargo clippy -p calculator -p firstlang -- -D warnings && \
cargo build -p calculator -p firstlang && \
cargo test -p calculator -p firstlang && \
rustup run nightly cargo clippy -p secondlang -p thirdlang -- -D warnings && \
rustup run nightly cargo build -p secondlang -p thirdlang && \
rustup run nightly cargo test -p secondlang -p thirdlang && \
cd book && mdbook build
""" }