-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathpixi.toml
More file actions
132 lines (101 loc) · 5.62 KB
/
pixi.toml
File metadata and controls
132 lines (101 loc) · 5.62 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
[workspace]
authors = ["ehsanmok <ehsanmok@users.noreply.github.com>"]
channels = ["conda-forge"]
name = "create-your-own-lang-with-rust"
platforms = ["osx-arm64", "linux-64"]
version = "0.1.0"
[dependencies]
rust = ">=1.83.0,<2"
mdbook = ">=0.4.40,<0.5"
# =============================================================================
# Tasks
# =============================================================================
[tasks]
# -----------------------------------------------------------------------------
# Book tasks
# -----------------------------------------------------------------------------
# Install mdbook-linkcheck (run once)
install-linkcheck = "cargo install mdbook-linkcheck"
# Build the book
book-build = { cmd = "mdbook build", cwd = "book" }
# Run linkcheck on the book
linkcheck = { cmd = "mdbook build", cwd = "book", depends-on = ["install-linkcheck"] }
# Build and serve the book locally (opens browser)
book = { cmd = "mdbook serve --open", cwd = "book" }
# -----------------------------------------------------------------------------
# Test tasks
# -----------------------------------------------------------------------------
# Run all tests (stable Rust for calculator/firstlang, nightly for secondlang/thirdlang)
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"
# Run all tests
tests = { cmd = "cargo test -p calculator -p firstlang && rustup run nightly cargo test -p secondlang -p thirdlang" }
# -----------------------------------------------------------------------------
# Example tasks
# -----------------------------------------------------------------------------
# Run calculator example
example-calculator = "cargo run -p calculator --bin main examples/simple.calc"
# Run firstlang examples
example-firstlang-fib = "cargo run -p firstlang -- firstlang/examples/fibonacci.fl"
example-firstlang-factorial = "cargo run -p firstlang -- firstlang/examples/factorial.fl"
# Run secondlang examples (requires nightly)
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"
# Run thirdlang examples (requires nightly)
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"
# Run all examples
examples = """
cargo run -p calculator --bin main calculator/examples/simple.calc && \
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/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
"""
# -----------------------------------------------------------------------------
# Code quality tasks
# -----------------------------------------------------------------------------
# Check code formatting
format-check = "cargo fmt --all -- --check"
# Format code
format = "cargo fmt --all"
# Run clippy lints (stable projects)
clippy = "cargo clippy -p calculator -p firstlang -- -D warnings"
# Run clippy for secondlang (requires nightly)
clippy-secondlang = "rustup run nightly cargo clippy -p secondlang -- -D warnings"
# Run clippy for thirdlang (requires nightly)
clippy-thirdlang = "rustup run nightly cargo clippy -p thirdlang -- -D warnings"
# Run all clippy lints
clippy-all = { cmd = "cargo clippy -p calculator -p firstlang -- -D warnings && rustup run nightly cargo clippy -p secondlang -p thirdlang -- -D warnings" }
# Lint: format check + clippy (all projects)
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 tasks
# -----------------------------------------------------------------------------
# Build all projects (stable)
build = "cargo build -p calculator -p firstlang"
# Build secondlang (requires nightly)
build-secondlang = "rustup run nightly cargo build -p secondlang"
# Build thirdlang (requires nightly)
build-thirdlang = "rustup run nightly cargo build -p thirdlang"
# Build everything
build-all = { cmd = "cargo build -p calculator -p firstlang && rustup run nightly cargo build -p secondlang -p thirdlang" }
# -----------------------------------------------------------------------------
# CI task (runs everything)
# -----------------------------------------------------------------------------
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
""" }