Repository navigation
Expand file tree
/
Copy pathMakefile.toml
More file actions
78 lines (68 loc) · 1.91 KB
/
Copy pathMakefile.toml
File metadata and controls
78 lines (68 loc) · 1.91 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
#
# Cargo Make Configuration
#
[config]
reduce_output = false
skip_core_tasks = true
# This is a virtual workspace; run each task once at the root (our tasks already
# use --workspace) rather than letting cargo-make fan them out per member, where
# root-only tasks like assemble-release-assets don't exist.
default_to_workspace = false
#
# Environment and Profile Setup
#
# default profile
[env]
CAPCURL_BUILD_FLAGS = ""
# TODO: support more than just linux when it makes sense
TARGET_ARCH = { condition.env_not_set = ["TARGET_ARCH"], value = "x86_64" }
TARGET_LIBC = { condition.env_not_set = ["TARGET_LIBC"], value = "musl" }
TARGET_VENDOR = { condition.env_not_set = ["TARGET_VENDOR"], value = "unknown" }
CARGO_BUILD_TARGET = { condition.env_not_set = [
"CARGO_BUILD_TARGET",
], value = "${TARGET_ARCH}-${TARGET_VENDOR}-linux-${TARGET_LIBC}" }
RUSTFLAG_STATIC = { condition.env_true = [
"STATIC_BINARY",
], value = "-Ctarget-feature=+crt-static" }
RUSTFLAGS = { script = ["echo ${RUSTFLAG_STATIC}"] }
# release profile
# Use with: cargo make --profile release <task>
[env.release]
CAPCURL_BUILD_FLAGS = "--release"
#
# Tasks
#
[tasks.clippy]
install_crate = "clippy"
command = "cargo"
args = ["clippy", "--workspace", "--all-targets"]
dependencies = ["rustup-target-add"]
[tasks.format]
install_crate = "rustfmt"
command = "cargo"
args = ["fmt", "--", "--emit=files"]
[tasks.format-check]
install_crate = "rustfmt"
command = "cargo"
args = ["fmt", "--all", "--", "--check"]
[tasks.clean]
command = "cargo"
args = ["clean"]
[tasks.rustup-target-add]
command = "rustup"
args = ["target", "add", "${CARGO_BUILD_TARGET}"]
[tasks.build]
command = "cargo"
args = ["build", "--workspace", "@@split(CAPCURL_BUILD_FLAGS, )"]
dependencies = ["rustup-target-add"]
[tasks.test]
command = "cargo"
args = ["test", "--workspace"]
dependencies = ["rustup-target-add"]
[tasks.ci]
dependencies = [
"format-check",
"clippy",
"build",
"test",
]