-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathTaskfile.yml
More file actions
110 lines (93 loc) · 2.82 KB
/
Copy pathTaskfile.yml
File metadata and controls
110 lines (93 loc) · 2.82 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
version: "3"
vars:
RUST_LOG: info
tasks:
setup:
desc: "Set up the development environment"
cmds:
- rustup update stable
- cargo install cargo-deny || true
- cargo install cargo-machete || true
- cargo install cargo-sort || true
- cargo install cargo-edit || true
- poly hooks install
update:
desc: "Update dependencies"
cmds:
- cargo update
- gau --update .
upgrade:
desc: "Upgrade dependencies to latest (including incompatible) then update"
cmds:
- cargo upgrade --incompatible
- task: update
build:
desc: "Build all crates"
cmds:
- cargo build --workspace
build:release:
desc: "Build release binary"
cmds:
- cargo build --release -p alef
test:
desc: "Run all tests"
cmds:
- cargo test --workspace
test:release:
desc: "Run all tests in release mode (catches release-only optimizer/lifetime issues)"
cmds:
- cargo test --release --workspace
bench:
desc: "Run codegen benchmarks (criterion)"
cmds:
- cargo bench
check:
desc: "Type-check all crates"
cmds:
- cargo check --workspace
fmt:
desc: "Format all code via poly"
cmds:
- poly fmt --fix .
format:
desc: "Format all code via poly"
cmds:
- poly fmt --fix .
format:check:
desc: "Check formatting via poly (CI)"
cmds:
- poly fmt --check .
lint:
desc: "Run all linters via poly"
cmds:
- poly lint .
lint:check:
desc: "Run check-only linting via poly (CI)"
cmds:
- poly lint .
set-version:
desc: "Set package version (usage: task set-version -- 0.18.0 or 0.18.0-rc.1)"
requires:
vars: [CLI_ARGS]
cmds:
# Use `sed -i.bak ... && rm -f` for portability between BSD sed (macOS) and GNU sed (Linux CI).
- |
version="{{.CLI_ARGS}}"
version="${version#v}"
if ! printf '%s\n' "$version" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z._-]+)?$'; then
echo "set-version: expected semver like '0.18.0' or '0.18.0-rc.1' (with or without leading 'v'); got '{{.CLI_ARGS}}'" >&2
exit 2
fi
sed -i.bak "s/^version = \".*\"/version = \"$version\"/" Cargo.toml
rm -f Cargo.toml.bak
sed -i.bak "s/^alef_version = \".*\"/alef_version = \"$version\"/" alef.toml
rm -f alef.toml.bak
sed -i.bak -E "s|pub const ALEF_REV: &str = \"v?[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z._-]+)?\";|pub const ALEF_REV: \&str = \"v$version\";|" src/core/template_versions.rs
rm -f src/core/template_versions.rs.bak
CARGO_TARGET_DIR=target/schema-task cargo run --quiet -- schema --schema-version "$version" --output schemas/alef.schema.json
- cargo update
clean:
desc: "Clean build artifacts"
cmds:
- cargo clean
- rm -rf .alef/