-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathjustfile
More file actions
60 lines (47 loc) · 1.52 KB
/
justfile
File metadata and controls
60 lines (47 loc) · 1.52 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
name := 'cosmic-osd'
rootdir := ''
prefix := '/usr'
polkit-agent-helper-1 := '/usr/libexec/polkit-agent-helper-1'
cargo-target-dir := env('CARGO_TARGET_DIR', 'target')
base-dir := absolute_path(clean(rootdir / prefix))
bin-dst := base-dir / 'bin' / name
# Default recipe which runs `just build-release`
[private]
default: build-release
# Compiles with debug profile
build-debug *args:
env POLKIT_AGENT_HELPER_1={{polkit-agent-helper-1}} cargo build {{args}}
# Compiles with release profile
build-release *args: (build-debug '--release' args)
# Compiles with vendored dependencies
build-vendored *args: vendor-extract (build-release '--frozen --offline' args)
# Build a debian package locally without a schroot or vendoring
build-deb:
dpkg-buildpackage -d -nc
# Runs `cargo clean`
clean:
cargo clean
# `cargo clean` and removes vendored dependencies
clean-dist: clean
rm -rf .cargo vendor vendor.tar
# Runs a clippy check
check *args:
cargo clippy --all-features {{args}} -- -W clippy::pedantic
# Runs a clippy check with JSON message format
check-json: (check '--message-format=json')
# Installs files
install:
install -Dm0755 {{ cargo-target-dir / 'release' / name }} {{bin-dst}}
# Vendor Cargo dependencies locally
vendor:
mkdir -p .cargo
cargo vendor | head -n -1 > .cargo/config.toml
echo 'directory = "vendor"' >> .cargo/config.toml
tar pcf vendor.tar vendor
rm -rf vendor
# Extracts vendored dependencies
[private]
vendor-extract:
#!/usr/bin/env sh
rm -rf vendor
tar pxf vendor.tar